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 sizeof int?

0 Answers  


atoi, which takes a string and converts it to an integer. write a program that reads lines(using getline), converts each line to an integer using atoi and computes the average of all the numbers read. also compute the standard deviation

0 Answers  


How to swap two values using a single variable ? condition: Not to use Array and Pointer ?

6 Answers  


Why string is used in c?

0 Answers  


Explain which function in c can be used to append a string to another string?

0 Answers  






What is the c language function prototype?

0 Answers  


What is difference between %d and %i in c?

0 Answers  


#include<stdio.h> #include<conio.h> struct stu { int i; char j; }; union uni { int i; char j; }; void main() { int j,k; clrscr(); struct stu s; j=sizeof(s); printf("%d",j); union uni u; k=sizeof(u); printf("%d",k); getch(); } what is value of j and k.

2 Answers   Facebook,


How to explain the final year project as a fresher please answer with sample project

0 Answers  


how to find out the biggest element (or any other operation) in an array which is dynamic. User need not to mention the array size while executing.

3 Answers  


.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }

0 Answers  


ABCDCBA ABC CBA AB BA A A

4 Answers   TCS,


Categories