Pages

Write a program to get two numbers from user and print their sum on the screen using function.

Friday, 19 April 2013


Sum Through Function:

#include<stdio.h>
#include<conio.h>
int sum(int x,int y);

int main()
{
 int a,b;
 printf("enter the value of a\n");
 scanf("%d",&a);
  printf("enter the value of b\n");
 scanf("%d",&b);
 printf("the sum is %d\n",sum(a,b));
 getch();
}
int sum(int x,int y)
{
return x+y;
}

 

Search Box

Most Reading

Contact Form

Name

Email *

Message *