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

every function has return the value?

1 Answers  


Which of the Following will define a type NODE that is a node in a Linked list? A)struct node {NODE*next;int x;};type def struct node NODE; B)typedef struct NODE {struct NODE *next;int x;}; C)typedef struct NODE {NODE *next;int x;}; D)typedef struct {NODE *next;int x;}NODE;

5 Answers   Accenture, TCS,


what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555

0 Answers   Wipro,


Write a code on reverse string and its complexity.

0 Answers   Expedia,


4)What would be the output? main() { int num=425; pf("%d",pf("%d",num)); } a)Comp error b)4425 c)4253 d)3435 e)none

10 Answers  


The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none

0 Answers  


void main() { int a=1; while(a++<=1) while(a++<=2); }

4 Answers   HCL,


What is the sizeof () a pointer?

0 Answers  


Determine if a number is a power of 2 at O(1).

2 Answers  


What does p mean in physics?

0 Answers  


How to create struct variables?

0 Answers  


Explain the difference between exit() and _exit() function?

0 Answers  


Categories