User Define Function- LeapYear Q. Write a C program to find - TopicsExpress



          

User Define Function- LeapYear Q. Write a C program to find entered year is leap year or not using own created function say leap. Ans. c program for find year is leap year or not using user define function leap #include int leap(int ); int main() { int year; printf(Enter any year : ); scanf(%d, &year); if(leap(year)) printf(\n%d is leap year,year); else printf(\n%d is not leap year,year); return 0; } int leap(int y) { if((y%400==0 && y%100==0)||(y%4==0)) return 1; else return 0; } The output of above program would be:
Posted on: Mon, 27 Jan 2014 15:53:11 +0000

Trending Topics



Recently Viewed Topics




© 2015