Home Basic Loop Array string Function Pointer Contact STUDY

AHF    C    PROGRAM    SOLVING

Programming tips

Header file



Specifer



Working with switch case



Test expression



Iterative statement




Leap Year




// AHF C PROGRAM SOLVING

//solving here basic type of programming problem

#include<stdio.h> #include<math.h> #define pf printf int main() { int year; pf("\nEnter any year: "); scanf("%d",&year); if(year%4 == 0) { if(year%100 == 0) { if(year%400 == 0) pf("\n%d is leap year.",year); else pf("\n%d is not leap year.",year); } else pf("\n%d is leap year.",year); } else pf("\n%d is not leap year.",year); return 0; }
OUTPUT:


© 2018 - All rights reserved