How to get a decimal in value in the following program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • FaRsAnA
    New Member
    • Jul 2013
    • 1

    How to get a decimal in value in the following program

    Code:
    #include<iostream.h>
    #include<conio.h>
    void main()
      {
       int a,b,c,d;
       float e;
       c=a+b;
       d=a-b;
       e=a/b;
       cout<<"sum="<<c;
       cout<<"diff="<<d;
       cout<<"quotient="<<e;
       getch();
       }
    Assuming a=5 and b=2
    I am not getting the quotient in decimals
    then how to get the quotient in decimal value
    Last edited by Rabbit; Jul 4 '13, 06:14 PM. Reason: Please use code tags when posting code.
Working...