- 3
Can any one help me to solve this.
Give me source code for this. Output : 0 0 0 1 2 3 2 4 6 3 6 9 4 8 12
9 Respostas
+ 3
You should show your attempt first.
Hint: use a for loop and a while loop inside it. In the first line each element is increasing by 0, in the second each increasing by 1 and so on..
+ 2
#include <stdio.h>
int main() {
for(int i=0; i<5; i++) printf("%d %d %d \n", i, i+i, i+2*i);
return 0;
}
+ 1
Save your tryout code as new code bit in SoloLearn, and share its link in your question Description. That way ayone can check it, and suggest accordingly.
https://www.sololearn.com/post/75089/?ref=app
+ 1
Pihu ( Not Active ) inside the last prinf statement add a newline character(\n).
+ 1
for(int i=0; i<5; i++) printf("%d %d %d \n", i, i*2, i*3);
// Keep learning & happy coding :D
0
I am try this but it is not working 😔
0
Here, try to understand it:
int i=0,j=0,k=0;
while(k<=12){
printf("%d %d %d\n",i,j,k);
i+=1;j+=2;k+=3;
}
Good luck!
0
It is a loop from 0 to 4, the second number is the index * by 2 and the third by 3.. So find the print fumction to print 3 numbers; i, i*2, i*3