Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program to add numbers using function

Posted By: Tilly Hughes     Category: C Programming     Views: 5393

Write a program to add numbers using function.

Code for Program to add numbers using function in C Programming

#include <stdio.h>
int add (int x, int y)    //A
{
    int z;        //B
    z = x + y;
    return (z);    //C
}
main ()
{
    int i, j, k;
    i = 10;
    j = 20;
    k = add(i, j);        //D
    printf (“The value of k is%d\n”, k);    //E
}
  
Share: 


Didn't find what you were looking for? Find more on Program to add numbers using function Or get search suggestion and latest updates.

Tilly Hughes
Tilly Hughes author of Program to add numbers using function is from London, United Kingdom.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!