Write a program that meets the following requirements: 1. Your program will read
ID: 644924 • Letter: W
Question
Write a program that meets the following requirements: 1. Your program will read three integers from the keyboard. 2. Print the largest integer. 3. Print the numbers from O to the smallest of the integers read from the keyboard. 4. You must make meaningful use of el se 5. Do not print anything other than what is required. 6. Your program will not he tested with negative integers. Your program should produce output similar to that shown below (red text indicates characters typed from the keyboard): Example 1:Explanation / Answer
#include<stdio.h>
int main(){
// Recieving input from keybopard.. and showing largest of three..
//declaring three numbers..
int a, b, c;
int d;
printf("Enter three numbers: "); //asking to enter three numbers
scanf("%d %d %d", &a, &b, &c); //tyaking three numbers..
if(a>=b && a>=c)//comparing a with b and c
printf("Largest number = %d", a); //if a is high showing a as large.
if(b>=a && b>=c) //comparing b with c and a
printf("Largest number = %d", b); //showing b as largest one...
if(c>=a && c>=b)//comparing a and b wioth c..
printf("Largest number = %d", c); //showing c as largest one..
printf("Enter integer to get smallest integers ");
scanf(%d,&d);
for(int i=d;i<=0;i--){
printf(i);
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.