- 1

#include<stdio.h> #include<stdlib.h> int main(void) { float num1,num2,num3,average; printf("enter three numbers");

3rd Jul 2022, 9:45 PM
Nadhil An
Nadhil An - avatar
8 odpowiedzi
+ 3
Seperate the parameters of scanf() with a comma "," scanf("%f%f%f",&num1,&num2, &num3);
4th Jul 2022, 12:37 AM
Arsenic
Arsenic - avatar
+ 3
Nadhil An Please attach your code so we may help you find your mistake
3rd Jul 2022, 10:25 PM
Rik Wittkopp
Rik Wittkopp - avatar
+ 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; }
3rd Jul 2022, 10:27 PM
Nadhil An
Nadhil An - avatar
+ 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.
4th Jul 2022, 5:10 PM
Emerson Prado
Emerson Prado - avatar
+ 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.
4th Jul 2022, 6:07 PM
Emerson Prado
Emerson Prado - avatar
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; }
4th Jul 2022, 3:58 PM
Nadhil An
Nadhil An - avatar
0
Can you solve my error?
4th Jul 2022, 3:58 PM
Nadhil An
Nadhil An - avatar
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?
4th Jul 2022, 5:11 PM
Nadhil An
Nadhil An - avatar