Computer Science, asked by zorojuro04, 3 months ago

Write a program that inputs three numbers and calculate the sum of all three numbers.​

Answers

Answered by muhamadalihasan50
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