write a program to display reverse of a number using for
loop?
Answer Posted / jayesh jain
#include<stdio.h>
#include<conio.h>
void main()
{
int num,i;
int rem;
clrscr();
printf("\n enter number");
scanf("%ld",&num);
printf("\n the reverse of number %ld is ",num);
for(i=0;num>0;i++)
{
rem=num%10;
num=num/10;
printf("%d",rem);
}
getch();
}
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
What is typedef?
Explain the use of keyword 'register' with respect to variables.
Mention four important string handling functions in c languages .
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
Why is c fast?
What is meant by keywords in c?
What does typedef struct mean?
Write a program for Overriding.
What is an lvalue in c?
What is malloc() function?
Study the following C program :call_me (myvar)int myvar;{ myvar +- 5; }main(){int myvar;myvar = 3;call_me(myvar);printf("%d ",myvar);What will be printed a) 3 b) 5 c) 8 d) symbol
Explain why can’t constant values be used to define an array’s initial size?
What are valid signatures for the Main function?
Is there a way to switch on strings?
Is anything faster than c?