How who I have my printf statement to have the numbers come out like thisn (no stars these should be spaces)
*** 10
*** 50
*** 250
*** 650
*** 1250
Thanks!!
This is what I have
printf("%d\n", k);
10
50
250
650
1250
How who I have my printf statement to have the numbers come out like thisn (no stars these should be spaces)
*** 10
*** 50
*** 250
*** 650
*** 1250
Thanks!!
This is what I have
printf("%d\n", k);
10
50
250
650
1250
Last edited by Frank_Rye; 10-28-2005 at 02:48 PM.
grr no its not coming out like I put it I must be to the left not right side
I have no idea what you want, so if the following example doesn't help, please be more specific and use code tags to preserve formatting:
Code:#include <stdio.h> #define length(a) ( sizeof (a) / sizeof *(a) ) int main ( void ) { int a[] = {1,10,100,1000}; int i; for ( i = 0; i < length ( a ); i++ ) printf ( "%-5d***\n", a[i] ); puts ( "" ); for ( i = 0; i < length ( a ); i++ ) printf ( "%5d***\n", a[i] ); puts ( "" ); for ( i = 0; i < length ( a ); i++ ) printf ( "***%5d\n", a[i] ); puts ( "" ); for ( i = 0; i < length ( a ); i++ ) printf ( "***%-5d\n", a[i] ); return 0; }
My best code is written with the delete key.