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; }

16th Oct 2020, 11:51 AM
GameR of SparTa
GameR of SparTa - avatar
2 ответов
+ 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
16th Oct 2020, 11:55 AM
Slick
Slick - avatar
0
They're format specifier warnings. double -> %lf sizeof -> unsigned int -> %u
16th Oct 2020, 12:07 PM
你知道規則,我也是
你知道規則,我也是 - avatar