Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Program to input a number and check if it's even or odd.
- #include<stdio.h>
- #include<conio.h>
- void main()
- {
- int number;
- clrscr();
- printf("Enter a number: ");
- scanf("%d", &number);
- if(number % 2 == 0)
- printf("The number %d is even.", number);
- else
- printf("The number %d is odd.", number);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment