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 the use of a semicolon (;) at the end of every program statement?

1 Answers  


To find whether a number is even or odd without using any conditional operator??

12 Answers   College School Exams Tests, IBM,


what is the purpose of the code, and is there any problem with it. bool f( uint n ) { return (n & (n-1)) == 0; }

1 Answers   Google,


What is difference between class and structure?

0 Answers  


What is #line in c?

0 Answers  


What is structure and union in c?

0 Answers  


What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

0 Answers  


any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above

0 Answers  


what are the advantage of pointer variables? write a program to count the number of vowels and consonants in a given string

3 Answers  


how to devloped c lenguege?

4 Answers  


What is malloc return c?

0 Answers  


Is this program statement valid? INT = 10.50;

0 Answers  


Categories