APC-PRAC-012.c ​
Metadata ​
- Author — Amit Dutta (amitdutta4255@gmail.com)
- Last updated — 12 Dec 2025
- License — MIT
Problem Statement ​
Problem Statement
Write a program to input three integer and find out second largest
Source Code ​
Printing the code
To print this file, open it on GitHub and click Raw before printing, or use the Download Raw button above and print directly from that page.
c
#include <stdio.h>
int main()
{
int a, b, c, secondLargest;
printf("Enter three number : ");
scanf("%d %d %d", &a, &b, &c);
if ((a < b && a > c) || (a > b && a < c))
secondLargest = a;
if ((b < a && b > c) || (b > a && b < c))
secondLargest = b;
if ((c < b && c > a) || (c > b && c < a))
secondLargest = c;
printf("\nSecond Largest : %d", secondLargest);
return 0;
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16