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 |
void main() {int a[5],i,b=16; for(i=0;i<5;i++) a[i]=2*i; f(a,5,b); for(i=0;i<5;i++) printf("\n %d",a[i]); printf("\n %d",b); } f(int *x,int n,int y) { int i; for(i=0;i<n;i++) *(x+i)+=2; y=y+2; }wat r the errors in the prg.and improvise the prg to get o/p.?
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
What do you understand by normalization of pointers?
implement NAND gate logic in C code without using any bitwise operatior.
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
Write a program to accept a character & display its corrosponding ASCII value & vice versa?
hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .
0 Answers Aegis, CDAC, Infosys,
What is pass by reference in functions?
main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); }
11 Answers CISOC, CitiGroup, College School Exams Tests,
how memory store byte
Write a c program to enter a string of paragraph and replacing a particular word which is repeated in the paragraph by another word?
2 Answers ME, Synfusion, Wipro,
Differentiate abs() function from fabs() function.