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 |
a c code by using memory allocation for add ,multiply of sprase matrixes
What is p in text message?
about c language
What are preprocessor directives in c?
What is null character in c?
What are near, far and huge pointers?
0 Answers Hexaware, Thomson Reuters, Virtusa,
In C language, a variable name cannot contain?
in C-programming language without using printf statement can we get output r not ? if yes how and if no also how ?
What does it mean when the linker says that _end is undefined?
What's the best way to declare and define global variables?
What is the use of a ‘