#include<stdio.h>
#include<conio.h>
void main()
{
int a[20],i;
clrscr();
printf("enter 20 numbers: ");
for(i=0;i<20;i++)
scanf("%d",&a[i]);
for(i=0;i<20;i++)
printf("%d\n",a[i]);
getch();
}
ronnel09_1
0
Newbie Poster
Recommended Answers
Jump to PostHi,
use int for main() and return 0. Then you could try if and else to break up a long print out like so:#include<stdio.h> #include<conio.h> int main() { int a [20], i; int count = 0; //clrscr (); printf("enter 20 numbers:"); for ( i = 0 …
Jump to PostMake your printf() format, occupy 80/number of columns you want to have including spaces between columns.
If I want 4 columns, I have my printf() format use 20 spaces, etc.
#include <stdio.h> int main(void) { int n; for(n=0;n<200;n++) { printf(" %18d ",n); //4 columns, each one 18+2 …
All 5 Replies
2teez
43
Posting Whiz
Adak
419
Nearly a Posting Virtuoso
ronnel09_1
0
Newbie Poster
ronnel09_1
0
Newbie Poster
Adak
419
Nearly a Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.