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);
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
Step by Step Solution
3.40 Rating (163 Votes )
There are 3 Steps involved in it
include int main declare variables int i double d char ch char s100 read an i... View full answer
Get step-by-step solutions from verified subject matter experts
