0
Why this C cod gives me error?
#include<stdio.h> int main(){ int a1=42; char b1=66; char b2='C'; float c1=4.2; double d1=0.21; printf("%d %c %10d %.1f %.2f %s",a1,b1,b2,c1,d1,"Bilim\n"); printf("%d byte\n",sizeof(char)); printf("%d byte\n",sizeof(int)); printf("%d byte\n",sizeof(short int)); printf("%d byte\n",sizeof(long int)); printf("%d byte\n",sizeof(float)); printf("%d byte\n",sizeof(double)); return 0; }
2 Respostas
+ 2
they're just warnings. But i would still change each printf line. instead of using %d specifier, use: %ld instead. Then it won't throw warnings
0
They're format specifier warnings.
double -> %lf
sizeof -> unsigned int -> %u