0

Write a program that inputs single character and three integer numbers, then perform addition between the three numbers, if user

is that? #include<stdio.h> int main() { int character,integer1,integer2,integer3; int p,addition,s; printf("enter first integer",integer1); scanf("%d",&integer1); printf("enter sec integer",integer2); scanf("%d",&integer2); printf("enter third integer",integer3); scanf("%d",&integer3); addition=integer1+integer2+integer3; printf("%d",addition); s=integer1*integer2*integer3; printf("%d",s); p=(integer1+integer2+integer3)/3; printf("%d",p); printf("enter character:",character); scanf("%d",&character); if (character=s){ printf("multiplication",s); scanf("%d",&s); } if (character=p){ printf("average",p); scanf("%d",&p); } }

5th Apr 2018, 4:33 PM
Jordan
Jordan  - avatar
1 Resposta
0
The title of this question is too long, so we can't read it all. And you need to initialize your character variable as the correct type, not as int.
5th Apr 2018, 4:38 PM
Daniel Nedergaard
Daniel Nedergaard - avatar