Home Basic Loop Array string Function Pointer Contact STUDY

AHF    C    PROGRAM    SOLVING

Programming tips

Working with switch case



Test expression



Comment



Header file



Specifer




Function_ reverse of an integer




// AHF C PROGRAM SOLVING

//The problem are solving here using FUNCTION

#include<stdio.h> #include<math.h> #define pf printf //function declaration int reveres(int n); void main() { int x,rev; printf("Enter any number: "); scanf("%d",&x); //function call rev=reveres(x); printf("\nReveres= %d",rev); return 0; } //function definition int reveres(int n) //function header //function body { int temp,r=0; while(n!=0) { temp=n%10; r=r*10+temp; n/=10; } return r; }
OUTPUT:


© 2018 - All rights reserved