Computer for SEE and NEB

It is a complete SEE and NEB solution for computer science. It includes Computer Fundamentals, Database (SQL), Programming in C QBASIC, CSS, JavaScript, and PHP for beginners.

Breaking

Post Top Ad

Your Ad Spot

Sunday, July 31, 2022

C program to print input digits in reverse order

 C program to print input digits in reverse order


#include<stdio.h>

#include<conio.h>

main()

{

            int num,n=0,rev=0,d;

            printf("Enter any number\n");

            scanf("%d",&num);

            n=num;

            while(num>0)

            {

                        d=num%10;

                        rev=rev*10+d;

                        num=num/10;

            }

            printf("%d",rev);

getch();

}

No comments:

Post a Comment

Post Top Ad

Your Ad Spot

Pages