HOW TO FIND OUT THE RREVERS OF A GIVEN DIGIT NUMBER IF IT
IS INPUT THROUGH THE KEYBORD BY USING C LANGUAGE
Answer Posted / prof.gagandeep jagdev
#include<stdio.h>
#include<conio.h>
long int num,result=0,i;
void main()
{
clrscr();
printf("\nenter the number to be reversed=");
scanf("%ld",&num);
while(num>0)
{
i=num%10;
num=num/10;
result=result*10+i;
}
printf("\nReversed number is=%ld",result);
getch();
}
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
Describe the steps to insert data into a singly linked list.
What is c system32 taskhostw exe?
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.
Explain what is a static function?
Can a void pointer point to a function?
What is file in c language?
Where is c used?
What is the purpose of sprintf() function?
What is a pragma?
What is the difference between array and structure in c?
What is malloc return c?
Hai what is the different types of versions and their differences
Why header files are used?
Write a Program to accept different goods with the number, price and date of purchase and display them
Is c a great language, or what?