Tuesday, April 6, 2021

18.2. Write a function that gets two integers and returns sum.

#include<stdio.h>
#include<conio.h>
int Sum(int a, int b)
{
return a+b;
}
void main()
{
int x, y;
clrscr ();
printf ("Enter first number: ");
scanf("%d",&x):
printf ("Enter second number: ");
scanf ("&d", &y):
printf ("Sum of %d and and is %d" is, Sum(x,y)); 
getch ();
}

No comments:

Post a Comment