By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,162 Members | 1,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,162 IT Pros & Developers. It's quick & easy.

How to get a decimal in value in the following program

P: 1
Expand|Select|Wrap|Line Numbers
  1. #include<iostream.h>
  2. #include<conio.h>
  3. void main()
  4.   {
  5.    int a,b,c,d;
  6.    float e;
  7.    c=a+b;
  8.    d=a-b;
  9.    e=a/b;
  10.    cout<<"sum="<<c;
  11.    cout<<"diff="<<d;
  12.    cout<<"quotient="<<e;
  13.    getch();
  14.    }
Assuming a=5 and b=2
I am not getting the quotient in decimals
then how to get the quotient in decimal value
Jul 4 '13 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.