Code In Tech - The Ultimate World of Computer Technology

Sunday, 25 March 2012

C program for arithmetic operation between two numbers

SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
 int a,b,ans;
 clrscr();
 printf("enter a number :");
 scanf("%d",&a);
 printf("enter second number :");
 scanf("%d",&b);

 ans=a+b;
 printf("Addition is %d",ans);
 ans=a-b;
 printf("\nsubstraction is %d",ans);
 ans=a*b;
 printf("\nmultiplication is %d",ans);
 ans=a/b;
 printf("\ndivision is %d",ans);
 getch();
}

No comments :

Post a Comment