Hi I am new to C++ codeing and I was recetly writng a program to multiply two numbers. When both numbers are whole the program works perfectly though when one number in in decimal form the program doesn't work please help.
[code]
#include<iostream>
using namespace std;
int main()
{
int a,b,c; //variables
cout<<"enter the value of Fergies :";
cin>>a;
cout<<"enter the value of Lergies :";
cin>>b;
Remember int is declaring an integer, which do not include decimals. In order to perform this with decimals, you need to declare a, b, and c as either double or float.
@Ok Hey Its Z: You can also declare it as a doublefloat.
@OP Use the [code- ]Tag at the beginning of your code and a [/code-] but without the "-" part tag at the end of your code to put it in a box like this....