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
Write a program to find the max of two numbers in c
Description :
You have to read two integers from user and find the maximum of two integers.
Sample Execution :
Test case 1 :
Enter the num1 : 10
Enter the num2 : 20
Max of two numbers is 20
Test case 2 :
Enter the num1 : 95
Enter the num2 : 25
Max of two numbers is 95
PROGRAM:
---------------------------------------------------------------------------------------------------------------
#include<stdio.h>
int main()
{
int num1,num2;
printf("Enter the num1:");
scanf("%d",&num1);
printf("Enter the num2:");
scanf("%d",&num2);
if(num1>=num2)
{
printf("max of two numbers is %d",num1);
}
else if(num2>=num1)
{
printf("max of two numbers is %d",num2);
}
}
---------------------------------------------------------------------------------------------------------------
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