Comment on Tutorial - while (1) Loops in C++ By Reema sen



Comment Added by : Jorgeus

Comment Added at : 2012-08-30 09:07:03

Comment on Tutorial : while (1) Loops in C++ By Reema sen
#include <iostream>
using namespace std;

//While loop

main()

{
int num=1;
while(num<=10)
{
cout<<num<<endl;
num++;
}
return 0;
}


Output:
1
2
3
4
5
6
7
8
9
10

Try this, it's very simple


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. works like a charm, though i didn't understand why
View Tutorial          By: primus at 2010-05-19 04:46:18

2. Hi
I can compile it
root$ javac -cp

View Tutorial          By: Tebogo Modiselle at 2014-10-31 08:47:09

3. Thank alot
View Tutorial          By: Naganatarajan at 2010-01-07 05:54:17

4. I have modified this example a bit and I'm using a
View Tutorial          By: Lee Murray at 2010-11-02 03:41:56

5. Hey nice article Brian W. Kernighan and/or Dennis
View Tutorial          By: butt at 2013-01-17 07:12:21

6. this helped a lot!!!!
View Tutorial          By: karthik rk at 2012-09-04 16:32:25

7. i think i can use it in my project in IT.
<

View Tutorial          By: jamesmae amado at 2013-11-17 13:42:58

8. Wow, incredible code!! With some brains this is a
View Tutorial          By: Dem0-n at 2011-06-11 07:10:12

9. finally an understandable example
View Tutorial          By: sdf at 2012-11-26 21:44:34

10. can you please e mail me a code about hotel reserv
View Tutorial          By: princeton at 2008-09-19 02:32:13