I want to find the maximum value of two numbers, and print it. I want to print all three numbers. I am using the following code.
#include<stdio.h>
#include<conio.h>
main()
{
//clrscr();
int a,b,c;
printf("insert two numbers:");
scanf("%d%d", &a, &b);
c = (a>b) ? a : b;
printf("\nmaximum of %d",a," and %d",b," is = %d" c);
getch();
}
However, I receive two syntax errors (Please find the attached figure). Could anybody help me out with it?
This question is related to
c
printf
syntax-error
printf("\nmaximum of %d and %d is = %d",a,b,c);
Change the line where you print the output to:
printf("\nmaximum of %d and %d is = %d",a,b,c);
See the docs here
Source: Stackoverflow.com