Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
0 of .
Results for:
P. 1

# Function Add Sub Mul Div

Ratings: (0)|Views: 190|Likes:

### Availability:

See more
See less

10/19/2012

pdf

text

original

-------------------------------------------------------------------------------------------------------------------------------
Problem:
Function that perform basic arithmetic operationi.e.Addition, Subtraction,Multiplication and Division.-------------------------------------------------------------------------------------------------------------------------------#include <conio.h>#include <stdio.h>void add(int,int);void sub(int,int);void mul(int,int);void div(int,int);void main(){clrscr();int n1,n2;printf("Enter the 1st no: ");scanf("%d",&n1);printf("\nEnter the 2nd no: ");scanf("%d",&n2);add(n1,n2);sub(n1,n2);mul(n1,n2);div(n1,n2);getch();}void add(int n1, int n2){printf("\n%d + %d = %d",n1,n2,n1+n2);}void sub(int n1, int n2){printf("\n%d -%d = %d",n1,n2,n1-n2);}void mul(int n1, int n2){printf("\n%d * %d = %d",n1,n2,n1*n2);}