#include <stdio.h>
#include <stdlib.h>
Hello, I was wondering why this program doesn't execute. It seems as though I've always been having trouble with performing the scanf function properly. I get the error of:
error: ignoring return value of scanf declared with attribute warn_unused_result
Note: I know there is a more efficient method for writing my current program, but that is beside the point. I want to know what this error means and why I keep getting it and possibly a solution. Thank you guys. Here is the code:
int main (int argc, char *argv[]){
int x;
int y;
int z;
int temp;
scanf("%d", &x);
scanf("%d", &y);
scanf("%d", &z);
if (x > y) {
temp = x;
x = y;
y = temp;
}
if (y > z) {
temp = y;
y = z;
z = temp;
}
if (x > z) {
temp = x;
x = z;
z = temp;
}
printf("%d", x);
printf("%d", y);
printf("%d", z);
return EXIT_SUCCESS; }