Search This Blog
Welcome to 1printf(), your ultimate destination for C, C++, Linux, Data Structures, and Microcontroller programming! ๐ ๐นLearn advanced coding techniques in C& C++ ๐นMaster Linux internals & shell scripting ๐นDeep dive into Data Structures & Algorithms ๐นExplore Embedded Systems & Microcontrollers (8051,UART, RTOS) ๐นGet hands-on coding tutorials, project ideas,and interview preparation tips Whether you're a beginner or an experienced programmer, this channel will help you
Featured
- Get link
- X
- Other Apps
Find Smallest of Three Numbers in C
✅ Find the Smallest of Three Numbers in C
#include<stdio.h>
int main() {
int a, b, c;
printf("Enter any three numbers:\n");
scanf("%d %d %d", &a, &b, &c);
if (a <= b && a <= c) {
printf("Smallest number among three is: %d\n", a);
}
else if (b <= a && b <= c) {
printf("Smallest number among three is: %d\n", b);
}
else {
printf("Smallest number among three is: %d\n", c);
}
return 0;
}
๐ Explanation:
This C program helps you find the smallest number out of three inputs using conditional logic. It compares:
- First if
ais smaller than or equal to bothbandc. - If not, it checks if
bis the smallest. - If both conditions fail,
cis the smallest.
๐งพ Sample Output:
Enter any three numbers: 12 9 27 Smallest number among three is: 9
๐ Keywords:
Smallest of three numbers, if else in C, compare numbers in C, minimum value logic, basic C programs, beginner C examples
๐ Hashtags:
#CProgramming #SmallestNumber #IfElseC #MinOfThree #BeginnerC #LogicInC
Popular Posts
C++ Program for Hybrid Inheritance (All Types Together)
- Get link
- X
- Other Apps
C++ Program for Function Overloading Example
- Get link
- X
- Other Apps
Comments
Post a Comment