D d@rK nEmEsIs Inactive Forerunner Aug 5, 2008 #1 help me guys really noob in C language how to get this output PHP: 1 12 123 1234 12345 123456
H hammerhead Inactive Discoverer Aug 5, 2008 #2 From the top of my mind, try pasting it in main() and then run Code: for(int i=1;i<=6;i++) { for(int j=1;j<=i;j++) { printf("%d",j); } printf("\n"); } I would suggest you understand the code first before running it.
From the top of my mind, try pasting it in main() and then run Code: for(int i=1;i<=6;i++) { for(int j=1;j<=i;j++) { printf("%d",j); } printf("\n"); } I would suggest you understand the code first before running it.
D d@rK nEmEsIs Inactive Forerunner Aug 5, 2008 #3 thanks for help dude but I want the output using just two if operators any help here
sarang Inactive Explorer Aug 6, 2008 #4 use label and goto thats the only way IMO yu can do it with only ifs.
H hammerhead Inactive Discoverer Aug 6, 2008 #5 H@cKer said: thanks for help dude but I want the output using just two if operators any help here Click to expand... I do not understand, please clarify further.
H@cKer said: thanks for help dude but I want the output using just two if operators any help here Click to expand... I do not understand, please clarify further.
D d@rK nEmEsIs Inactive Forerunner Aug 6, 2008 #6 hammerhead said: I do not understand, please clarify further. Click to expand... what our maam told us is to use two if condition to get the output not to use any loop:S wtf one more thing to to print odd number from 1 to 100 without using any loop
hammerhead said: I do not understand, please clarify further. Click to expand... what our maam told us is to use two if condition to get the output not to use any loop:S wtf one more thing to to print odd number from 1 to 100 without using any loop
N nukeu666 Inactive Explorer Aug 6, 2008 #7 one more thing to to print odd number from 1 to 100 without using any loop Click to expand... recursive function main() { func(1); } func(int a) { if(a<100) {print (a);a+=2; func(a);} } similar solution for the other problem...ill let you figure that out yourself (you can techboi to do your homework also )
one more thing to to print odd number from 1 to 100 without using any loop Click to expand... recursive function main() { func(1); } func(int a) { if(a<100) {print (a);a+=2; func(a);} } similar solution for the other problem...ill let you figure that out yourself (you can techboi to do your homework also )
H hammerhead Inactive Discoverer Aug 6, 2008 #8 Recursion seems the only logical option left if you want to do it without loops.