You are on page 1of 6

Q) Second greatest of three numbers

Write a program to find the second greatest of three numbers.


Sample Input:
5
7
8
Sample Output:
7
Case 1 Case 2
Input (stdin) Input (stdin)
123 9 8 10
Output (stdout) Output (stdout)
2 9

This video is a sole property of Talent Battle Pvt. Ltd. Strict Penal Action will be taken against unauthorized piracy of this video
#include <stdio.h> if(n1 > n3)
int main() {
{ printf("%d", n1);
int n1, n2, n3; }
scanf("%d%d%d",&n1,&n2,&n3); else
if(n1 > n2 && n1 > n3) {
{ printf("%d", n3);
if(n2 > n3) }
{ }
printf("%d", n2); else
} {
else if(n1 > n2)
{ {
printf("%d", n3); printf("%d", n1);
} }
} else
else if (n2 > n3) {
{ printf("%d", n2);
}
}
return 0;
}
This video is a sole property of Talent Battle Pvt. Ltd. Strict Penal Action will be taken against unauthorized piracy of this video
Video Solution Link : https://youtu.be/zXon4JD-XGg

This video is a sole property of Talent Battle Pvt. Ltd. Strict Penal Action will be taken against unauthorized piracy of this video
Q) Circumference of a circle
Write a program to find the circumference of a circle.
The input radius must be a float variable, the output circumference should be printed as a
floating point value with 2 point precision. No other extra information should be printed
except the circumference value to the stdout. (Assume PI = 3.14)

Case 1 Case 2
Input (stdin) Input (stdin)
5 7
Output (stdout) Output (stdout)
31.40 43.96

This video is a sole property of Talent Battle Pvt. Ltd. Strict Penal Action will be taken against unauthorized piracy of this video
#include<stdio.h>
int main()
{
float r,c;
scanf("%f",&r);
c=2*3.14*r;
printf("%0.2f",c);
return 0;
}

This video is a sole property of Talent Battle Pvt. Ltd. Strict Penal Action will be taken against unauthorized piracy of this video
Video Solution Link : https://youtu.be/kOM7-UlLOEU

This video is a sole property of Talent Battle Pvt. Ltd. Strict Penal Action will be taken against unauthorized piracy of this video

You might also like