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

Question #28241
Using an if-else statement, kindly HELP write down a C code that will assign the maximum of a and b to an integer variable called Max
1
Expert's answer
2013-04-16T09:31:38-0400
#include<stdio.h>

int main()
{
printf("Input a : ");
int a;
scanf("%d",&a);
printf("Input b : ");
int b;
scanf("%d",&b);

int max;
if(a > b)
& max = a;
else
& max = b;

printf("max = %d",max);&
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 the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS