answersLogoWhite

0


Best Answer

#include <iostream>

int main()

{

int i=0;

while( i<10 )

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

return( 0 );

}

User Avatar

Wiki User

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

Wiki User

8y ago

int x = 1;

do {

if (!(x%2)) printf ("%d\n", x);

} while ++x<=10;

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you print 1 to 10 numbers using while loop in C?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

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

c the book mastering c


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 do you print square using for loops?

how to print "square" using for loop


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

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


How do you print 1 to 100 without using loop in php?

The best way to print the numbers 1 to 100 in PHP without using a loop is with the following code: echo implode("&lt;br&gt;", range(1,100)); You can replace the &lt;br&gt; with anything that you want to separate the numbers, such as dashes. I used a line-break in the example.


How do you create a loop (for loop, while loop) in Python?

In Python, you can create loops using different constructs, such as the for loop and the while loop. These loops allow you to repeatedly execute a block of code until a specific condition is met. Here's how you can create loops in Python: for loop: A for loop is used when you want to iterate over a sequence of elements such as a list, tuple, or string. It executes a block of code for each item in the sequence. for item in sequence: # Code block to be executed Here's an example that prints the numbers from 1 to 5 using a for loop: for num in range(1, 6): print(num) 2 while loop: A while loop is used when you want to repeat a block of code as long as a certain condition is true. It keeps executing the code block until the condition becomes false. while condition: # Code block to be executed Here's an example that prints the numbers from 1 to 5 using a while loop: num = 1 while num


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


C program to print numbers 1 to n?

how do we use loops in c plus plus programing and what are basic differences between do,for and while loop


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 } }


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 do you print numbers from 2 to1000 using while loop?

int i = 2; while (i &lt;= 1000) { printf ("%d\n", i); i++; }


To print unique no using for loop?

int main (void) { puts ("unique"); }