Home Basic Loop Array string Function Pointer Contact STUDY

AHF    C    PROGRAM    SOLVING

Programming tips

Test expression



Header file



Working with switch case



Iterative statement



Specifer




Function_ find divisible number




// AHF C PROGRAM SOLVING

//The problem are solving here using FUNCTION

#include<stdio.h> #include<math.h> #define pf printf //function declaration int fact(int); void main() { int a,res; pf("Enter devised number: "); scanf("%d",&a); //function call res=fact(a); return 0; } //function definition int fact(int n) //function header //function body { int i,p; for(i=1;i<=100;i++) { if(i%n==0) pf("\n%d is divisible number.",i); //giving output withing 100 } }
OUTPUT:


© 2018 - All rights reserved