how to find out the reverse number of a digit if it is
input through the keyboard?
Answers were Sorted based on User's Feedback
Answer / vignesh1988i
A SMALL IM IMPLEMENTATION OF POINTERS.
#include<stdio.h>
#include<conio.h>
void main()
{
int n,*k,l;
printf("enter the number :");
scanf("%d",&n);
k=&n;
for(int i=1;*k>0;i++)
{
l=(*k)%10;
*k=(*k)/10;
printf("%d",l);
}
getch();
}
Is This Answer Correct ? | 10 Yes | 1 No |
Answer / sneha
main( )
{
int x,result,next;
printf("Enter The number to revers=");
scanf("%d",&x);
//5th
result=x%10;
result=result*10;
//4th
next=(x/10)%10;
result=(result+next)*10;
//3rd
next=(x/100)%10;
result=(result+next)*10;
//2nd
next=(x/1000)%10;
result=(result+next)*10;
//1st
next=(x/10000)%10;
result=result+next;
printf("%d",result);
}
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / amrit
int main()
{
int a = 5678;
int temp=0,rev;
while((a%10)!=0)
{
rev =a%10;
a=a/10;
temp= temp*10+ rev;
}
return 0;
}
Is This Answer Correct ? | 4 Yes | 2 No |
Answer / haris
Try it. It will seriously work. You would appreciate it.
#include<stdio.h>
#include<conio.h>
int main()
{
int x;
int a,b,c,d,e,f,g,h,i;
int sum;
printf("Please enter a five digit number:\n");
scanf("%d",&x);
a=x%10;
b=(x/10)% 10;
c=(x/100)% 10;
d=(x/1000)%10;
e=(x/10000)%10;
f=a*10000;
g=b*1000;
h=c*100;
i=d*10;
sum=f+g+h+i+e;
printf("\n\nThe sum of all digits is %d.",sum);
getch();
return 0;
}
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / prince rafi
void main()
{
int num,m,temp=0;
clrscr();
printf("enter the value of num);
do
{
m=m%10;
temp=(temp*10)+m;
num=num/10;
}
while(num>0);
printf("%d",sum);
}
getch();
}
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sreejesh1987
int rev(int,int);
void main()
{
int a,b;
clrscr();
printf("\nEnter the number to reverse:");//456
scanf("%d",&a);
b=a%10;//b=6
printf("\nReverse of the number is: %d",rev(a,b));
getch();
}
int rev(int a,int b)
{
if(a>9)//456
{
a=a/10;//a=45
b=b*10+a%10;//65
return rev(a,b);
}
else
return b;
}
Is This Answer Correct ? | 0 Yes | 0 No |
how to count no of words,characters,lines in a paragraph.
write a program in c language that uses function to locate and return the smallest and largest integers in an array,number and their position in the array. it should also find and return the range of the numbers , that is , the difference between the largest number and the smallest.
How can I insert or delete a line (or record) in the middle of a file?
What is the argument of a function in c?
What is variable initialization and why is it important?
How can I trap or ignore keyboard interrupts like control-c?
please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics
What are disadvantages of C language.
what will be the output of the following program, justify? #define TEST int TEST getdata() { static i; i+=10; return i; } main() { int k; k = getdata(); }
what is a function prototype?
What is volatile variable in c with example?
What does the c preprocessor do?