Fix code C only #include int main() { int i; double d; char ch; char s[100]; printf(Enter
Fantastic news! We've Found the answer you've been seeking!
Question:
Fix code C only
#include
int main()
{
int i;
double d;
char ch;
char s[100];
printf("Enter integer:");
scanf("%d",&i);
printf("Enter double:");
scanf("%lf",&d);
printf("Enter character:");
scanf("%c",&ch);
scanf("%c",&ch);
printf("Enter string:");
scanf("%s",s);
printf("%d %.2lf %c %s",i,d,ch,s);
//printf("%s %c %.2lf %d",s,ch,d,i);
printf("%.2lf cast to an integer is%d",d,(int)d);
return 0;
}
Error showing
99
3.77
z
Howdy
Your output starts with
Enter integer:
Enter double:
Enter character:
Enter string:
99 3.77 z Howdy
3.77 cast to an integer is 3
Expected output starts with
Enter integer:
Enter double:
Enter character:
Enter string:
99 3.770000 z Howdy
Howdy z 3.770000 99
3.770000 cast to an integer is 3
0 / 1
Related Book For
Posted Date: