Search



Saturday, 7 February 2015

Divide

In this program, float a,b,c statement declares 3 variables named as a,b & c . The 2 values
are entered by user because of scanf statement & stored in a & b . Now, c variable 
stores the division of a & b which is then displayed on screen using printf statement. 
For more information & explanation of this program click here.. 

Program to divide two numbers.

#include<stdio.h>
#include<conio.h>
void main()
{       float a,b,c;
clrscr();
printf("program to divide 2 variables");
printf("\n enter value of a : ");
scanf("%f",&a);
printf(" enter value of b : ");
scanf("%f",&b);
c = a/b;
printf("after (a/b) ans = %f",c);
getch();
}



No comments:

Post a Comment

Guys if you think something is wrong or should be edit than please do comment.