simple c program for 12345 convert 54321 with out using string

Answer Posted / abhradeep chatterjee

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
printf("enter a number");
scanf("%d",&i);
for(int n=1;n<=5;n++)
{
j=i%10;
i=i/10;
printf("%d",j);
}
getch();
}

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

624


Explain what header files do I need in order to define the standard library functions I use?

645


Explain how can I read and write comma-delimited text?

648


‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.

1876


how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions

2717






Explain can static variables be declared in a header file?

676


What is break statement?

629


i got 75% in all semester am i eligible for your company

1733


Are there namespaces in c?

566


Explain what is the difference between #include and #include 'file' ?

581


What is the return type of sizeof?

588


What is a header file?

634


4. main() { int c=- -2; printf("c=%d",c); }

1364


What is a MAC Address?

624


What is the use of ?: Operator?

660