Program to input 3 no’s and identify the greatest among the 3 , java program , c program , nested if program , if else program
Program to input 3 no’s and identify the greatest among the 3 , java program , c program , nested if program , if else program
Program type 1 ( by nested if else )
// // main.c // GreatestAmongThreeNumbers // // Created by SHIVAM SINGH on 14/10/22. // #include <stdio.h> int main() { int a , b, c ; printf("Input first no : "); scanf("%d",&a); printf("Input second no : "); scanf("%d",&b); printf("Input third no : "); scanf("%d",&c); if (a>b) { if(a>c) { printf("First No is greatest"); } else { printf("Third No is greatest"); } } else { if(b>c) { printf("Second No is greatest"); } else { printf("Third No is greatest"); } } printf("\n"); return 0; }
Program type 2 ( by ladder if else )
#include <stdio.h> int main() { int a , b, c ; printf("Input first no : "); scanf("%d",&a); printf("Input second no : "); scanf("%d",&b); printf("Input third no : "); scanf("%d",&c); if (a>b && a>c) { printf("First no is greatest"); } else if(b>a && b>c) { printf("Second no is greatest"); } else{ printf("Third no is greatest"); } printf("\n"); return 0; }
Note : There may be more solutions for this same program.
Topics Covered :
- program to find the largest number
- absolute maximum and minimum
- in assembly language
- programming assembly language
- assembly language tutorial in english
- maximum among 3 numbers
- learn assembly language
- assembly programming language
- relative extrema
- assembly language programming tutorial
- sticky notes
- relative maximum
- absolute extrema
- assembly language programming
- maximum three number
- assembly language tutorial
- assembly language tutorial for beginners
Thanks for reading this blog. Hope you get satisfied with the blog and definitely this blog must have valued your time and effort of reading.
Take a time to connect our other digital creations such as Instagram , Facebook and Youtube.
Social Media Links of Tech DCode :
YouTube : https://www.youtube.com/channel/UCjJnEdeugftBwQ3yMuD4B_A
Instagram : https://www.instagram.com/thetechdcode/
Facebook Page : https://www.facebook.com/thetechdcode
Twitter : https://twitter.com/thetechdcode
Telegram Channel : https://t.me/thetechdcode
Tech DCode Linktree : https://linktr.ee/thetechdcode
My Personal Handles : https://linktr.ee/virtualshivamin
Social Media Links of SHIVAM SINGH (OWNER) :
Instagram : https://www.instagram.com/virtualshivamin/
Facebook Page : https://www.facebook.com/virtualshivamin/
Twitter : https://twitter.com/virtualshivamin/
Personal Linktree : https://linktr.ee/virtualshivamin
[…] answer : click here […]