Ad Code

NEW POST

6/recent/ticker-posts

4 IN 1 FUNCTION PROGRAM ADDITION,SUBTRACTION,DIVISION,MULTIPLICATION

 C CODE(RUNS ON TURBO C++):

#include<stdio.h>

#include<conio.h>

//int c;

int sum(int a,int b)

{

return a+b;

}

int sub(int a, int b)

{

return a-b;

}

int mul(int a,int b)

{

return a*b;

}

float div(int a,int b)

{

return a/b;

}

void main()

{

int a,b;

clrscr();

printf("enter number for operations\n");

scanf("%d%d",&a,&b);

printf("\naddition of enter numbers is =%d",sum(a,b));

printf("\nsubtraction of enter numbers is =%d",sub(a,b));

printf("\nmultiplication of enter numbers is =%d",mul(a,b));

printf("\ndivision of enter numbers is =%f",div(a,b));

getch();

}

Post a Comment

0 Comments