adplus-dvertising
frame-decoration

Question

What is the output of C Program with functions?
#include 
int sum(int,int);
int main()
{
    int a=5, b=10, mysum;
    mysum = sum(a,b);
    printf("SUM=%d ", mysum);
    printf("SUM=%d", sum(10,20));
    return 0;
}
int sum(int i, int j)
{
    return (i+j);
}

a.

SUM=15 SUM=30

b.

SUM=30 SUM=15

c.

SUM=15 SUM=15

d.

SUM=30 SUM=30

Posted under C Programming

Answer: (a).SUM=15 SUM=30

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of C Program with functions?