0
Somebody please help me to understand!
#include<stdio.h> int main() { float a=3.0,b=4.0,c=5.0,d=6.0; printf("a+b-c=%f\n", a+b-c); printf("b%%a-c+b/a=%f\n", b%a-c+b/a); return 0; } error: invalid operands to binary expression ('float' and 'float') printf("b%%a-c+b/a=%f\n", b%a-c+b/a); ~^~
3 Answers
+ 2
#include<stdio.h>
int main()
{
int a=3,b=4,c=5;
printf("a+b-c=%d\n", a+b-c);
printf("b%%a-c+b/a=%d\n", b%a-c+b/a);
return 0;
} moduls operator float nihi leta use int
+ 1
Modulo operator is not defined for float.
Use the following instead.
#include <math.h>
printf("%f", fmod(4.0, 3.5));
0
Thank you