-->
Friday, June 24, 2022
Even or Odd check | C Programs
FindError
Home
Catagories
C Programs
C Graphics
Python Programs
About
contact
Home
About
Contact
C Programs
Swapping using 3rd variable
Swapping without using 3rd variable
Even or Odd check
Biggest among three numbers
Add all digits of a number
Add all Even digits of a number
Add all Odd digits of a number
Check wether a given number is Even or Odd
Q. Write a C program to check wether a given number is Even or Odd
Output
Source Code
// WAP to check wether a given number is Even or Odd // Code for TurboC++ compiler #include
#include
void main() { int n; clrscr(); printf("Enter a number:: "); scanf("%d",&n); if(n%2==0) printf("The number you have entered is even"); else printf("The number you have entered is odd"); getch(); }
Copy Code
// WAP to to check wether a given number is Even or Odd // Code for DevC++ compiler #include
int main() { int n; printf("Enter a number:: "); scanf("%d",&n); if(n%2==0) printf("The number you have entered is even"); else printf("The number you have entered is odd"); return 0; }
Copy Code
C Programs
Swapping using 3rd variable
Swapping without using 3rd variable
Even or Odd check
Biggest among three numbers
Add all digits of a number
Add all Even digits of a number
Add all Odd digits of a number
No comments:
Post a Comment
Newer Post
Older Post
Home
Contact Form
Name
Email
*
Message
*
No comments:
Post a Comment