-->
Friday, June 24, 2022
Find the biggest among three numbers | 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
Find the biggest among three numbers
Q. Write a C program to find the biggest among three numbers
Output
Source Code
// WAP to find the biggest among three numbers // Code for TurboC++ compiler #include
#include
void main() { int x,y,z; clrscr(); printf("\nEnter three numbers:: "); scanf("%d%d%d",&x,&y,&z); if(x>y) { if(x>z) printf("\n%d is the bigest number.",x); else printf("\n%d is the bigest number.",z); } else { if(y>z) printf("\n%d is the bigest number.",y); else printf("\n%d is the bigest number.",z); } getch(); }
Copy Code
// WAP to find the biggest among three numbers // Code for DevC++ compiler #include
int main() { int x,y,z; printf("\nEnter three numbers:: "); scanf("%d%d%d",&x,&y,&z); if(x>y) { if(x>z) printf("\n%d is the bigest number.",x); else printf("\n%d is the bigest number.",z); } else { if(y>z) printf("\n%d is the bigest number.",y); else printf("\n%d is the bigest number.",z); } 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