Write a program that inputs three numbers and calculate the sum of all three numbers.
Answers
Answered by
0
Answer:
I Hope you find your answer After my reply.
Explanation:
#include <stdio.h>
int num1,num2,num3;
int sum;
char line_text[50];
int main()
{
printf("Input three numbers separated by comma : ");
fgets(line_text, sizeof(line_text), stdin);
sscanf(line_text, "%d, %d, %d", &num1, &num2, &num3);
sum = num1+num2+num3;
printf("The sum of three numbers : %d\n", sum);
return(0);
}
Sample Output:
Input three numbers seperated by comma : 5,10,15
The sum of three numbers : 30
Similar questions
Chemistry,
1 month ago
English,
1 month ago
Social Sciences,
3 months ago
Math,
9 months ago
Computer Science,
9 months ago
English,
9 months ago