+ 2
Guys help me find an error in this program.
Or better ye give me a simpler program https://code.sololearn.com/c1UG7yJZWFGh/?ref=app
1 ответ
+ 51
There are a few errors in your code:
line 7:
- you are trying to output from scanf, which is an input function;
- you should then specify the type of the variables you want from input (%d, stands for "decimal") and the destination address of those variables (ex. &a, "address of a")
line 9:
- you are using square brackets instead of round brackets
- you are using the = operator which is used for assignment (== is the operator for confronting variables)
- you are using the ^ operator which is the "bit a bit" XOR operator
(you can use the function pow() from the math.h library or simply a*a)
should be something like:
int a,b,c;
printf("some text\n");
scanf("%d %d %d",&a,&b,&c);
if((a*a==b*b+c*c)||(b*b==c*c+a*a)||(c*c==b*b+a*a))
printf("some text\n");
else
printf("some text\n");
-> '\n' is used to output on a new line