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

What does c mean?

0 Answers  


a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none

0 Answers  


What are examples of structures?

0 Answers  


How to declare pointer variables?

0 Answers  


what is y value of the code if input x=10 y=5; if (x==10) else if(x==9) elae y=8; a.9 b.8 c.6 d.7

4 Answers   TCS,






how to use showbits function?

2 Answers   Infosys, TATA,


Does c have class?

0 Answers  


Why static is used in c?

0 Answers  


What does the characters “r” and “w” mean when writing programs that will make use of files?

0 Answers  


What will be printed as the result of the operation below: #include<..> int x; int modifyvalue() { return(x+=10); } int changevalue(int x) { return(x+=1); } void main() { int x=10; x++; changevalue(x); x++; modifyvalue(); printf("First output:%d\n",x); x++; changevalue(x); printf("Second output:%d\n",x); modifyvalue(); printf("Third output:%d\n",x); }

2 Answers  


Write a C/C++ program that connects to a MySQL server and checks intrusion attempts every 5 minutes. If an intrusion attempt is detected beep the internal speaker to alert the administrator. A high number of aborted connects to MySQL at a point in time may be used as a basis of an intrusion.

2 Answers   Drona Solutions, Infosys, Vodafone, Webyog,


Write a program to print factorial of given number using recursion?

0 Answers  


Categories