int i = 2;
while (i <= 1000) {
printf ("%d\n", i);
i++;
}
int x, y;
x = 5;
while (x>0) {
for (y=1; y<=x; ++y) {
printf ("%d", y);
}
printf (" "); /* space */
--x;
}
#include <iostream> int main() { int i=0; while( i<10 ) printf( "%d\n", ++i ); return( 0 ); }
unsigned count = 0;unsigned num=1; do { std::cout << num << std::endl; num +=2; } while (++count<50);
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
#include<stdio.h> main() { int a,i=1; printf("Enter max no"); scanf("%d",&a); do { printf("%d",i); i=i+2; }while(i<=a); }
//(this is just a function, call this as count(n) in your main loop) void count(int n){ int i = 1; do{ printf("%d", i); i++; } while(i<=n); }
x as int = 0 while x < 50 x = x + 1 print x endwhile
c the book mastering c
public static void main(String args){ int counter = 0; //initialize the counter variable to 0 while (counter < 10){ //while the counter variable is less than 10... counter ++; //increase the counter variable by 1 System.out.println(counter); //print the counter variable } }
For a=InputBox("enter no.") While a > 0 c = a Mod 10 a = a \ 10 End While Next Print(c) End Sub
int i=0; while (i++<n) { /*...*/ }
"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."
#include <iostream> int main() { int i=0; while( i<10 ) printf( "%d\n", ++i ); return( 0 ); }
unsigned count = 0;unsigned num=1; do { std::cout << num << std::endl; num +=2; } while (++count<50);
cls input "enter a name"; a$ b=1 while b <=1 print a$ b = b+1 wend end
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
Here's a start umbers=[True]*5001 index=2 primes=[] while index<5000: multiplier=2 while index*multiplier <= 5000: Numbers[index*multiplier]=False multiplier+=1 index+=1 while Numbers[index]==False and index < 5000: index+=1 for x in range(0,5000): if Numbers[x]==True: primes.append(x) x+=1 print primes
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.