Use if-else statement, write down a C code to assign the maximum of a and b to an integer variable called Max.
1
Expert's answer
2013-04-15T11:26:24-0400
//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; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment