423,818 Members | 2,266 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,818 IT Pros & Developers. It's quick & easy.

There are three errors.how can i fix it?

P: 1
#include<stdio.h>
int main()
{
int no1,no2,no3,max,min;
printf("Enter three numbers");
scanf("%d %d %d",&no1,&no2,&no3);
if (no1>no2) && (no1>no3)
max=no1;
else if (no2>no3)
min=no3;
else
min=no2;
if(no2>no1)&&(no2>no3)
max=no2;
else if (no1>no3)
min=no3;
else
min=no1;
if(no3>no1)&&(no3>no2)
max=no3;
else if(no1>no2)
min=no2;
else
min=no1;
printf("The largest number is %d \n",max);
printf("The smallest number is %d \n",min);


}
May 20 '18 #1
Share this Question
Share on Google+
1 Reply


weaknessforcats
Expert Mod 5K+
P: 9,196
Your 3 "if" statements are missing the outer parentheses:

Expand|Select|Wrap|Line Numbers
  1. if (stuff)
  2. {}
May 20 '18 #2

Post your reply

Sign in to post your reply or Sign up for a free account.