Home Basic Loop Array string Function Pointer Contact STUDY

AHF    C    PROGRAM    SOLVING

Programming tips

Comment



" ; " after loop



Iterative statement



Working with switch case



Header file




Print largest number among 10 numbers




// AHF C PROGRAM SOLVING

//solving here ITERATIVES STATEMENTS type of programming problem

#include<stdio.h> #include<math.h> #define pf printf int main() { int n=1,m,large=-1; while(n<=10) //ending condition of the loop { pf("\nEnter the #%d : ",n); //value will taken until the loop is end scanf("%d",&m); large=m>large?m:large; //testing condition n++; //update loop } pf("\nThe largest number is: %d",large); return 0; }
OUTPUT:


© 2018 - All rights reserved