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 pointer in c plus plus?
Program to find the absolute value of given integer using Conditional Operators
int a=0,b=2; if (a=0) b=0; else b=*10; What is the value of b ?
Explain the concept and use of type void.
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?
What is the output of the following program main();{printf ("chennai""superkings"}; a. Chennai b. superkings c. error d. Chennai superkings
Example of friendly function in c++
Compare interpreters and compilers.
In the below code, how do you modify the value 'a' and print in the function. You'll be allowed to add code only inside the called function. main() { int a=5; function(); // no parameters should be passed } function() { /* add code here to modify the value of and print here */ }
Explain b+ tree?
What is openmp in c?
Can one function call another?