find the minimum of three values inputted by the user

Answers were Sorted based on User's Feedback



find the minimum of three values inputted by the user..

Answer / manish soni bca 3rd year jaipu

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,min;
printf("Enter the 3 values");
scanf("%d %d %d",&a,&b,&c);
if(a<b)
{
if(a<c)
min=a;
else
min=c;
}
else
{
if(b<c)
min=b;
else
min=c;
}
printf("the minimum numbers of %d,%d and %d is=%
d",a,b,c,min);
getch();
}

Is This Answer Correct ?    4 Yes 0 No

find the minimum of three values inputted by the user..

Answer / manish soni bca 3rd year jaipu

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,min;
printf("Enter the 3 values");
scanf("%d %d %d",&a,&b,&c);
min=a<b?(a<c?a:c):(b<c?b:c);
printf("the minimum numbers of %d,%d and %d is=%
d",a,b,c,min);
getch();
}

Is This Answer Correct ?    2 Yes 0 No

find the minimum of three values inputted by the user..

Answer / neha tibrewal

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
printf("Enter three numbers");
scanff("%d%d%d",&a,&b,&c);
if(a<b && a<c)
printf("Minimum is %d",a);
elseif(b<a && b<c)
printf("Minimum is %d",b);
else
printf("Minimum is %d",c);
getch();
}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

What is action and transformation in spark?

0 Answers  


what is the use of c program?

4 Answers   Synergy, Web Synergies,


void main() { int x=25,y=32; clrscr(); x=x++ + y++; y=++x + ++y; printf("%d%d",x,y); }

5 Answers  


Difference between Class and Struct.

13 Answers   Ericsson, Motorola, Wipro,


consider the following program sigment int n,sum=1; switch(n) { case 2:sum=sum+2; case 3:sum*=2; break; default:sum=0;} if n=2, what is the value of sum a.0 b.6 c.3 d.none

7 Answers   TCS,






What is a rvalue?

0 Answers   Global Logic,


How can I implement a delay, or time a users response, with sub-second resolution?

0 Answers  


write an algorithm to display a square matrix.

0 Answers  


What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.

0 Answers  


What is the most efficient way to store flag values?

0 Answers  


Explain how can you be sure that a program follows the ansi c standard?

0 Answers  


In C language, a variable name cannot contain?

0 Answers  


Categories