write a program to display reverse of a number using for
loop?
Answer Posted / vishnu
int main()
{
int num;
int i;
int a[10];
printf("enter the number \n");
scanf("%d",&num);
for(i =0;num;i++)
{
a[i]=num %10;
num= num/10;
printf("%d",a[i]);
}
getch();
}
| Is This Answer Correct ? | 29 Yes | 21 No |
Post New Answer View All Answers
What does the c preprocessor do?
What are the advantages of Macro over function?
a value that does not change during program execution a) variabe b) argument c) parameter d) none
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
Is c weakly typed?
What is the correct code to have following output in c using nested for loop?
How can I call a function with an argument list built up at run time?
Can include files be nested? How many levels deep can include files be nested?
find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }
Why do we need functions in c?
What is the use of bitwise operator?
can anyone please tell about the nested interrupts?
What are the 5 organizational structures?
What was noalias and what ever happened to it?
What is the difference between ++a and a++?