How to write a C program to determine the smallest among
three nos using conditional operator?
Answers were Sorted based on User's Feedback
Answer / sai
#include<stdio.h>
#include<conio.h>
void main()
{
int n1,n2,n3,small;
clrscr();
printf("Enter three numbers");
scanf("%d%d%d",&n1,&n2,&n3);
small=n1<n2?(n1<n3?n1:n3):(n2<n3?n2:n3);
printf("smallest number is:%d",small);
printf("press any key to close");
getch();
}
| Is This Answer Correct ? | 32 Yes | 11 No |
Answer / azad sab;e,chiplun
void main()
{
int n1,n2,n3,small;
clrscr();
printf("Enter three numbers");
scanf("%d%d%d",&n1,&n2,&n3);
small=n1<n2?(n1<n3?n1:n3):(n2<n3?n2:n3);
printf("smallest number is:%d",small);
printf("press any key to close");
}
getch();
}
| Is This Answer Correct ? | 24 Yes | 21 No |
What is a C array and illustrate the how is it different from a list.
identify the in correct expression a.a=b=3=4; b.a=b=c=d=0; float a=int b=3.5; d.int a; float b; a=b=3.5;
Is there something we can do in C but not in C++? Declare variable names that are keywords in C++ but not C.
If we give two names then this displays the connection between the two people. It is nothing but flames game
how many keywords are available in 'c' language a) 32 b) 34 c) 45 d) 48
count the numbers between 100 and 300, that star with 2 and ends with 2
What do you mean by recursion in c?
if the address of a[1,1] and a[2,1] are 1000 and 1010 respectively and each occupies 2 bytes then the array has been stored in what order?
4 Answers Amazon, Apple, Bata, Google, NASA,
#define d 10+10 main() { printf("%d",d*d); }
input may any number except 1,output will always 1.. conditions only one variable should be declare,don't use operators,expressions,array,structure
Find the largest number from the given 2 numbers without using any loops and the conditional operator.
Can a pointer be static?