// C Program to check whether Year is Leap or not #include<stdio.h> //header file declaration #include<conio.h> void main() // main method { int year; // variable declaration printf("PROGRAM TO CHECK WHETHER YEAR IS LEAP OR NOT \n"); printf("Input year--- "); scanf("%d", &year); // Input year if (((year % 4 == 0) && (year % 100!= 0)) || (year%400 == 0)) //check condition { printf("It is a leap year", &year); } else { printf("It is not a leap year", &year); } getch(); } OUTPUT:
// C Program to count the number of digits entered #include <stdio.h> //header file declaration int main() //main method { int p, count=0; // variable declaration printf("Input Number--"); //Display input number scanf("%d",&p); while(p!=0) { p=p/10; count++; } printf("\nThe number of digits are: %d",count); ...
Comments
Post a Comment