36-Write a C program to calculate sum of two number using another function.

Program: 36

Write a C program to calculate sum of two number using another function.

#include
#include
int calsum(int x, int y, int z);
void main()
{
    int a, b, c, sum;
    printf("Enter any three numbers: ");
    scanf("%d %d %d", &a, &b, &c);
    sum=calsum(a,b,c);
    printf("Sum= %d\n", sum);
    getch();
}
int calsum(int x, int y, int z)
{
    int d;
    d= x+y+z;
    return (d);
}
Output
Enter any three numbers: 45 54 733

Sum= 832

Lokesh Kumar: Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.
Related Post
Leave a Comment

This website uses cookies.