-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexp-4-1.c
More file actions
39 lines (33 loc) · 780 Bytes
/
exp-4-1.c
File metadata and controls
39 lines (33 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*************************************************************************
> File Name: exp-4-1.c
> Author: xiaoxiaoh
> Mail: xiaoxxhao@gmail.com
> Created Time: Fri Jun 30 10:08:40 2017
************************************************************************/
/*
* Write a C program to find maximum between two numbers.
*
* Example
*
* Input
* Input num1: 10
* Input num2: 20
*
* Output
* Maximum = 20
*
*/
#include <stdio.h>
int main()
{
int num1, num2;
//read two numbers from user
printf("Enter two numbers: ");
scanf("%d%d", &num1, &num2);
//compare num1 with num2
if(num1 > num2)
printf("Maximum between %d and %d is %d\n", num1, num2, num1);
else
printf("Maximum between %d and %d is %d\n", num1, num2, num2);
return 0;
}