Created
February 12, 2020 13:03
-
-
Save putheakhem/5519d844702fe3b1d577cf87c44171a7 to your computer and use it in GitHub Desktop.
Write a function that can calculate the summation of 3 integers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
// code will post in the description of our youtube . | |
// Write a function that can calculate the summation of 3 integers | |
int sum( int a, int b, int c) { | |
// we can declare new variable to store the result from a+b+c | |
int sum = 0; | |
sum = a + b + c; | |
return sum; | |
} | |
int main() { | |
int a, b, c; | |
printf("Enter value of a: "); | |
scanf("%d", &a); | |
printf("Enter value of b: "); | |
scanf("%d", &b); | |
printf("Enter value of c: "); | |
scanf("%d", &c); | |
printf("the result of a + b + c is : %d", sum(a, b, c)); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment