ok.! understand now..
thank u very much!!!
correct aite? : ))Code:for ( i = x; i <= x + 3; i++ ) { printf("\t%d", i); for ( j = 2; j <= 5; j++ ){ printf("\t%d", i*j); } printf( "\n" ); }
so now.. should i use while or for to control my input?
ok.! understand now..
thank u very much!!!
correct aite? : ))Code:for ( i = x; i <= x + 3; i++ ) { printf("\t%d", i); for ( j = 2; j <= 5; j++ ){ printf("\t%d", i*j); } printf( "\n" ); }
so now.. should i use while or for to control my input?
It doesn't really matter which loop you use. If you keep asking questions without trying anything out for yourself, you will never learn. Like I said, Think about it and write some code, after that if you get stuck try to figure out why you are getting stuck. Dont just jump to posting the moment your done writing your code. You might be able to solve the problem faster if you try it yourself and youll learn something in the process too.so now.. should i use while or for to control my input?
ok.. i'll try it first... until i dont know wut should i do..
thanks guys.. =)
guys.. i got stuck again..
hurmm..~
how am i going to print | 2 3 4 5Code:printf("Enter a number between 1 to 20 (1-20): "); scanf("%d", &x); for ( i = x; i <= x + 3; i++ ) { printf("\t%d", i); printf("\t|"); for ( j = x; j <= x+3; j++ ){ printf("\t%d", i*j); } printf( "\n" ); } OUTPUT Enter a number between 1 to 20 (1-20): 2 2 | 4 6 8 10 3 | 6 9 12 15 4 | 8 12 16 20 5 | 10 15 20 25 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`` i want my output to be like below: Enter a number between 1 to 20 (1-20): 2 | 2 3 4 5 --------------------------------------------- 2 | 4 6 8 10 3 | 6 9 12 15 4 | 8 12 16 20 5 | 10 15 20 25
---------------------------------------------
I think you'll find that you've pretty much already done that if you look back one page.how am i going to print | 2 3 4 5