

InterviewSolution
Saved Bookmarks
1. |
Write a program to input three numbers and print the biggest among them with the help of conditionaloperator. |
Answer» <html><body><p><strong><a href="https://interviewquestions.tuteehub.com/tag/answer-15557" style="font-weight:bold;" target="_blank" title="Click to know more about ANSWER">ANSWER</a>:</strong></p><p># include <stdio.h></stdio.h></p><p> </p><p>void main()</p><p>{</p><p> <a href="https://interviewquestions.tuteehub.com/tag/int-11513" style="font-weight:bold;" target="_blank" title="Click to know more about INT">INT</a> a, <a href="https://interviewquestions.tuteehub.com/tag/b-387190" style="font-weight:bold;" target="_blank" title="Click to know more about B">B</a>, c, big ;</p><p> </p><p> <a href="https://interviewquestions.tuteehub.com/tag/printf-20695" style="font-weight:bold;" target="_blank" title="Click to know more about PRINTF">PRINTF</a>("Enter three <a href="https://interviewquestions.tuteehub.com/tag/numbers-22758" style="font-weight:bold;" target="_blank" title="Click to know more about NUMBERS">NUMBERS</a> : ") ;</p><p> </p><p> scanf("%d %d %d", &a, &b, &c) ;</p><p> </p><p> big = a > b ? (a > c ? a : c) : (b > c ? b : c) ;</p><p> </p><p> printf("\nThe biggest number is : %d", big) ;</p><p>}</p><p></p></body></html> | |