Get Email Subscription

Enter your email address:

Delivered by FeedBurner

Tuesday, March 2, 2010

Write a program in C to display the number from 1 to 200 in a series. Print 20 numbers on one line and use all the available columns on the screen.

Write a program in C to display the number from 1 to 200 in a series.
Print 20 numbers on one line and use all the available columns on the screen.


#include<stdio.h>
#include<conio.h>
main( )
{
int i;
clrscr( );
for (i=1; i < = 200; i++)
{
printf("%4d", i);
}
return(0);
}

Hint:-


20 values per line = 80/20 = 4 = %4d
4 values per line = 80/4 = 20 = %20d
8 values per line = 80/8 = 10 = %10d


Related Posts by Categories



0 comments:

About This Blog

Lorem Ipsum

  © Blogger templates Newspaper III by Ourblogtemplates.com 2008

Back to TOP