Hey everybody.
I am new to this forum, and i just started programming. I have been trying to make some different simple programs, but when i tried this, it just wouldn't put out a number at the end of the programming. I would appreciate some help. ( Also if you have some tricks to make some of the things in the program more simple plz tell me )
Here is the code.
Thx!Code:#include <iostream> using namespace std; double y; // Antal genstande! double x; // Vægt! double d; double j; int main() { cout<<" PROMILLE UDREGNER \n - af Alek -"; cin.get(); cout<<"Indsaet din vaegt i kg :"; d = 0.68 * x; cin>> x; cin.ignore(); cout<<"Indsaet antal indtagede genstande :"; j = 12 * y; cin>> y; cin.ignore(); cout<<"Din promille er: "; cout<< j / d; cin.get(); }
BTW, sorry if it is a bit messy.
The problem occurs when i want the last expression ( cout<< j / d ) to be shown off in the program, but it doesn't put out numbers, instead it writes something strange. If anybody knows what to do / or if i made an error ( which i probably did, please tell me)
P.S. The language is danish, might look a bit strange to some ppl.![]()



LinkBack URL
About LinkBacks
.


