write a program to display reverse of a number using for
loop?

Answers were Sorted based on User's Feedback



write a program to display reverse of a number using for loop?..

Answer / rockin pro

Answer
# 9 #include <stdio.h>
int main(void) {
int num[4], i;
printf("Enter the number :
");
printf("The reverse number is :
");
for(i = 4;i >= 0; i--) {
printf("%d",i);
printf("
");
}
return 0;
}

Thanks for Marking this A

Is This Answer Correct ?    0 Yes 1 No

write a program to display reverse of a number using for loop?..

Answer / k.ashok kumar

BETTER CODE:


#include<stdio.h>
#include<conio.h>
void main()
{
int a;
clrscr();
printf("\n Enter a number : ");
scanf("%d",&a);
printf("\n Reverse number of %d is : ",a);
while(a)
{
printf("%d",a%10);
a/=10;
}
getch();
}

Is This Answer Correct ?    6 Yes 8 No

write a program to display reverse of a number using for loop?..

Answer / vinit kumar rai

#include<stdio.h>
#include<conio.h>
void main()
{
long int num,i;
int d;
clrscr();
printf("\n enter number");
scanf("%ld",&n);
printf("\n the reverse of number %ld is ",num);
for(i=0;i>0;i=i\10)
{
d=i%10;
printf("%d",d);
}
getch();
}

Is This Answer Correct ?    10 Yes 13 No

write a program to display reverse of a number using for loop?..

Answer / vikas kumar from agra

#include<stdio.h>
#include<conio.h>
void main()
{
long int num,i;
int d;
clrscr();
printf("\n enter number");
scanf("%ld",&n);
printf("\n the reverse of number %ld is ",num);
for(i=0;i>0;i=i\10)
{
d=i%10;
printf("%d",d);
}
getch();
}

Is This Answer Correct ?    39 Yes 83 No

Post New Answer

More C Interview Questions

void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }

3 Answers   ME, pspl,


What is a pointer value and address in c?

0 Answers  


What is the usage of the pointer in c?

0 Answers  


"I LOVE MY COUNTRY" write a c program to get "COUNTRY MY LOVE I" as the output. Use any other programming language. It is not mandatory to use C.

11 Answers   ABC Infotech, ADP, College School Exams Tests, Kovair,


What is difference between stdio h and conio h?

0 Answers  






can a union be self-referenced?

1 Answers  


What is a struct c#?

0 Answers  


what is calloc and malloc?

2 Answers  


Write a program to display the no of bit difference between any 2 given numbers eg: Num1 will 12->1100 Num2 will 7->0111 the difference in bits are 2.

4 Answers  


What is string function c?

0 Answers  


What are the rules for the identifier?

0 Answers  


Differentiate between a for loop and a while loop? What are it uses?

0 Answers   TISL,


Categories