C program to calculate addition,subtraction,multiplication and division of two numbers

void main(){
float a,b,ans;
clrscr();
printf("Enter the two number\n");
scanf("%f%f",&a,&b);
ans=a+b;
printf("\addition=%f",ans);
ans=a-b;
printf("\subtraction=%f",ans);
ans=a*b;
printf("\multiplication=%f",ans);
if(b!=0){
ans=a/b;
printf("\Division=%f",ans);
}
else printf("Divisor must be a non zero value\n");
getch();
}

Comments

Popular posts from this blog

C Language Topics in Hindi and English

C language IMP Questions for BSc/BA/BCom/BCA/BE/BTech/MSc/MCA (CS/IT) I year students