- 1
#include<stdio.h> #include<stdlib.h> int main(void) { float num1,num2,num3,average; printf("enter three numbers");
8 odpowiedzi
+ 3
Seperate the parameters of scanf() with a comma ","
scanf("%f%f%f",&num1,&num2, &num3);
+ 3
Nadhil An
Please attach your code so we may help you find your mistake
+ 1
#include<stdio.h>
#include<stdlib.h>
int main(void) {
float num1,num2,num3,average;
printf("enter three numbers");
scanf("%f%f%f",&num1&num2&num3);
average=(num1+num2+num3)/3;
printf("average is:%f",average);
return 0;
}
+ 1
Nadhil An Also separate the scanf format specifiers with something, like a space or a comma. With "%f%f%f", the program can't tell tell which number is which.
+ 1
Nadhil An Yes. You are ramdomly changing the code purpose, instead of following the given hints. It's the perfect path to get lost.
0
int main(void){
int num;
printf("enter a number");
scanf("%d",&num);
if(num<0);
{
printf("number is negative");
}
else{
printf("number is positive");
}
return 0;
}
0
Can you solve my error?
0
#include<stdio.h>
int main(void)
{
int num1,num2;
printf("enter two numbers");
scanf("%d%d",&num1,&num2);
if(num1>number2){
printf("greater number is %d", number1);
}else{
printf("greater number is %d", number2);
}
return 0;
}
Can you find my error on this?