BCA SEM1 C PROGRAM

Write a program input the number and reverse it.
#include <stdio.h>
#include <conio.h>
void main()
{
int num,rev,rem:
clrscr():
printf("Input the number"):
scanf("%d", &num):
while(num>=0)
{
rev=(rev*10)+rem:
rem=num%10:
rev=num/10:
}
printf("REVERSE NO.=%d/n", rev):
}
getch()
}

Comments

Post a Comment