write a program to display reverse of a number using for
loop?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }
What is a pointer value and address in c?
What is the usage of the pointer in c?
"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?
can a union be self-referenced?
What is a struct c#?
what is calloc and malloc?
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.
What is string function c?
What are the rules for the identifier?
Differentiate between a for loop and a while loop? What are it uses?