H int main int number int printfenter a number

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: nts Next statement Next statement /* check a citizen is eligible for voting */ #include<stdio.h> int main() { int age; int printf(“Enter the age : ”); printf(“Enter scanf(“%d”,&age); scanf(“%d”,&age); if(age >= 18) if(age printf(“Eligible for voting…”); printf(“Eligible getch(); getch(); } /* print a number is even or odd */ #include<stdio.h> int main() { int number; int printf(“Enter a number : “); printf(“Enter scanf(“%d”, &number); scanf(“%d”, if((number %2) == 0) if((number printf(“%d is even number.”,number); printf(“%d else else printf(“%d is odd number.”,number); printf(“%d } /* check whether a year is leap year or not */ #include<stdio.h> int main() { int year; int printf("Enter the year ?"); printf("Enter True scanf("%d",&year); scanf("%d",&year); if((year %100) == 0) if((year { Test Test True if((year % 400) == 0) if((year condition2 condition2 printf("%d is leap year.&q...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online