#include <<iostream.h>> #include<<conio.h>> #include<<stdio.h>>
All three of these include files have too many << and >> . They should be:
#include <iostream>If you are writing a C++ program you should not need the second and third include file.
Also what is your compiler and compiler version?
Next lets look at the first do{}while(); loop.
int i=10;
int x=2;
do
{
cout<<x <===what should i write here? DO code.. the statement? i tried many things but it doesn't work.
}
while (x <= i)
In this code you are missing a semicolon on the end of your while line. So lets make this loop do something.
#include <iostream>
using namespace std;
int main()
{
int i=10;
int x=2;
do
{
cout << x << endl;
x += 2; // Add 2 to x
}while (x <= i);
} // end of main function.
This should print out even numbers from 2 to 10.
Please enter and compile and run this program. Does it work? Do you understand what this small program is doing?
Jim

New Topic/Question
Reply





MultiQuote



|