Friday, 4 April 2014

How to Divide Two Numbers in C Language

Division in C Programs is very easy as it is in Addition, subtraction and multiplication because pattern is same and also syntax is same. Just one operation is different and that is division. I have put all my efforts while creating this blog. However there are lots of other blogs websites are available for online learning of C Language programs but almost all are based on same complex method of teaching. But my teaching method id quite different as you can see

C Program to Divide Two Numbers

#include<stdio.h>
main()
{
     int var1,var2,answer;
     printf("\nEnter First Value:= ");
     scanf( "%d",&var1);

     printf("\nEnter Second Value:= ");
     scanf( "%d",&var2);

     answer=var1/var2;
     printf("\Answer Is:= %d ",answer);
}

Output of the program

Output of Division

No comments:

Post a Comment