Question:

C programming question?

by  |  earlier

0 LIKES UnLike

if user put

573

how can i show like 375,753,537 etc pls help

 Tags:

   Report

3 ANSWERS


  1. Its all upto your logic . It can be as follows in C...

    int iNum, iLen, k;

    char cNum[100];

    //Read the Number

    scanf("%d", &iNum);

    //convert it to a string

    itoa(iNum, cNum, 10);

    iLen = strlen(cNum);

    for(int i=iLen-1; i>=0; --i)

    {

          k = i;

          for(int j=0; j<iLen; ++j)

          {

                  printf("%c", cNum[k--]);

                  if(k<0) k=iLen-1;

          }

          printf(", ");

    }

    can't it be..??


  2. that is a little office virus?

  3. is the number of digits fixed ? In other words, is the number always with only 3 digits?

Question Stats

Latest activity: earlier.
This question has 3 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.