simple c program for 12345 convert 54321 with out using string

Answer Posted / mohit

#include<stdio.h>
#include<conio.h>
main()
{
long int num,x=0;
int b;
while(n>0)
{
b=num%10;
num=num/10;
x=x*10+b;
}
printf("new number=%ld",x);
getch();
}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the valid places to have keyword “break”?

647


In C, What is the #line used for?

1047


How to establish connection with oracle database software from c language?

1671


hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell

1667


What is data type long in c?

621






Under what circumstances does a name clash occur?

686


Tell me about low level programming languages.

640


Can you please explain the difference between strcpy() and memcpy() function?

596


Explain bit masking in c?

633


What is f'n in math?

617


What is the difference between c &c++?

643


number of times a digit is present in a number

1538


What are the advantages and disadvantages of pointers?

570


What is array in C

704


Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?

656