Program to enter three integers and output the smallest integer using IF 1 Attachment(s) Program to enter three integers and output the smallest integer using IF #include #include int main() { clrscr(); int x,y,z,smallest; cout << "Enter 3 integers : "; cin>>x>>y>>z; smallest=x; if(y if(z cout << "The smallest integer out of the 3 integers you typed "; cout << x << ", " << y << " & " << z << " is : " << "\n" << smallest << "\n"; getch(); return 0; } It then determines thesmallest integer of the three and prints it out using the 'cout' command. Sample Input 82 78 86 Sample Output The smallest integer out of the 3 integers you typed 82, 78 & 86 is : 78 |
All times are GMT +5. The time now is 01:19 AM. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.