Problem No: 06
Problem Name: Write a C program to input two numbers and determine which number is greater.
Objectives
• To learn how to receive input from the user using the scanf() function
• To understand the use of relational operators such as >, <.
• To apply decision-making using if–else statements
• To display results properly using the printf() function
Program (C Language):
Input and Output:
Input:
Enter first number: 5
Enter second number: 15
Output:
Discussion :From this assignment, I learned how to take user input using the scanf() function and
compare two integer values using conditional logic. The program evaluates whether the first number is
larger, the second number is larger, or if both numbers are the same. This task improves understanding of
decision-making concepts and the practical use of if–else statements in C programming.