63 152
Assignments Done
99,1%
Successfully Done
In July 2018

Answer to Question #28243 in C++ for Max Lek

Question #28243
Use if-else statement, write down a C code to assign the maximum of a and b to an integer variable called Max.
Expert's answer
//main function
int main()
{
int a,b;//variable a and b
printf("Enter number a: ");//Enter number a
scanf("%d",&a);
printf("Enter number b: ");//Enter number b
scanf("%d",&b);
//show result
if(a>b){
printf("Max is a = %d",a);
}else{
printf("Max is b= %d",b);
}
scanf("%d",&a);//delay
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions