Monday, December 10, 2007

How to store information into array

How to store information into array

To store information into array

#include

int main()

{ int array[5] , e;

for ( e=0; e<5;>

{ cout << "please key in the value for array numbers [" <<>

cin >> array[e];}

for (e = 0; e<5;>

cout <<" Array number "<

return 0;

}

Result :

How to draw a char with nested for-loop

How to draw a char with nested for-loop

To draw a char with nested for-loop

#include

int main( )

{ int w,length, width;

char plan;

cout << "How long you want to draw ? :";

cin >> length;

cout << "How width you wanted to draw ? : ";

cin >> width;

cout << "Please Enter An SYMBOL for the plan : ";

cin >> plan;

for (int i = 0; i

{ for (w = 0; w

cout <<>

cout << "\n";

}

return 0;

}

Result :

How to display a same word with for-loop

How to display a same word with for-loop

To display a same word with for-loop

#include

int main()

{

int times;

for (times = 0; times <>

cout <<"\n"<< "For loops testing! ";

return 0;

}

Result :

How to display a same word with while-loop

How to display a same word with while-loop

To display a same word with while-loop

#include

main( )

{ int counter = 0;

while(counter <>

{ counter++;

cout << "\n"<<"while-loop testing! ";

}

return 0;

}

Result :