I was assigned a problem in class that we have to write a program for. The teacher didnt explain how to solve problems yet and barley just showed us what cout does. ed.
I looked at the link but don't understand what it has to do with this. I've never done C++ and this is only 2nd week of class. I'm not good with terms yet.
If you post the code you've written we can review it and help you understand what's wrong. If you can't do that your best option is to get a book and study, possibly asking the teacher if he can help you.
//Write a program to find volume of a box
#include <iostream>
usingnamespace std;
int main ()
{
int volume, l, b, h;
cout << "Enter Length, Breadth and Height: ";
cin >> l >> b >> h;
volume = l * b * h;
cout <<"Volume is: "<< volume << endl;
getch ();
}
If these sorts of questions give difficulty, you need to study the topic, either by working through the tutorial from the start, or by working from whichever textbooks or teaching material is recommended for your course.