answersLogoWhite

0


Best Answer

int i = 2;

while (i <= 1000) {

printf ("%d\n", i);

i++;

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

8y ago

int x, y;

x = 5;

while (x>0) {

for (y=1; y<=x; ++y) {

printf ("%d", y);

}

printf (" "); /* space */

--x;

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you print numbers from 2 to1000 using while loop?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you print the numbers 1 through 50 using a do-loop while statement in Visual Basic.NET?

x as int = 0 while x &lt; 50 x = x + 1 print x endwhile


How to draw Flowchart to print prime numbers from 1 to 100 using while loop in c language?

c the book mastering c


Print 1-10 numbers using while loop?

public static void main(String args){ int counter = 0; //initialize the counter variable to 0 while (counter &lt; 10){ //while the counter variable is less than 10... counter ++; //increase the counter variable by 1 System.out.println(counter); //print the counter variable } }


How do you make serial numbers for a created software which people have to pay for and can only be used once using visual basic?

For a=InputBox("enter no.") While a &gt; 0 c = a Mod 10 a = a \ 10 End While Next Print(c) End Sub


How do you write a c program to print n no's required using while loop?

int i=0; while (i++&lt;n) { /*...*/ }


How can we print a book using google print?

"While it is possible to use this program to print a book, it is highly recommended to print it with an actual publisher. You will get a much better deal and your book will look a lot more professional."


How do you print 1 to 10 numbers using while loop in C?

#include &lt;iostream&gt; int main() { int i=0; while( i&lt;10 ) printf( "%d\n", ++i ); return( 0 ); }


Write a c or c plus plus program to print first 50 odd numbers using do while loop?

unsigned count = 0;unsigned num=1; do { std::cout &lt;&lt; num &lt;&lt; std::endl; num +=2; } while (++count&lt;50);


How will you print 10 studens name by using while loop statement in QBasic?

cls input "enter a name"; a$ b=1 while b &lt;=1 print a$ b = b+1 wend end


WAP To print the squares of all even numbers from 1 to 20?

CLS PRINT "PROGRAM: Print squares of all even numbers from 1 to 20" PRINT PRINT "number", "squared" PRINT FOR number% = 1 TO 20 IF number% MOD 2 = 0 THEN PRINT number%, number% * number% END IF NEXT END


Solution to find 1000th prime number using python?

Here's a start umbers=[True]*5001 index=2 primes=[] while index&lt;5000: multiplier=2 while index*multiplier &lt;= 5000: Numbers[index*multiplier]=False multiplier+=1 index+=1 while Numbers[index]==False and index &lt; 5000: index+=1 for x in range(0,5000): if Numbers[x]==True: primes.append(x) x+=1 print primes


How big are print ads?

It depends on where the print ad is going to be published. Most magazines are a bit larger than your standard 8.5"x11" piece of paper, while brochures and flyers using print ads can be larger or smaller.