Tuesday, April 6, 2021

18.3. Write a function that gets two integers and returns division.

#include<stdio.h>
#include<conio.h>
float Sum(int a, int b)
{
return (float)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 %f" is,x,y, Sum(x,y)); 
getch ();
}

No comments:

Post a Comment