Can any one help me to solve this. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 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

28th Nov 2021, 2:33 PM
First Last
9 Answers
+ 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..
28th Nov 2021, 2:41 PM
Arun Ruban SJ
Arun Ruban SJ - avatar
+ 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; }
30th Nov 2021, 9:13 AM
ANEGOUNI KARTHIK GOUD
ANEGOUNI KARTHIK GOUD - avatar
+ 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
28th Nov 2021, 3:19 PM
Ipang
+ 1
Pihu ( Not Active ) inside the last prinf statement add a newline character(\n).
28th Nov 2021, 6:19 PM
John Delvin
John Delvin - avatar
+ 1
for(int i=0; i<5; i++) printf("%d %d %d \n", i, i*2, i*3); // Keep learning & happy coding :D
28th Nov 2021, 9:06 PM
SoloProg
SoloProg - avatar
0
I am try this but it is not working 😔
28th Nov 2021, 2:45 PM
First Last
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!
28th Nov 2021, 3:25 PM
Abdulaziz Al-Shehhi
Abdulaziz Al-Shehhi - avatar
28th Nov 2021, 5:16 PM
Pihu ( Not Active )
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
30th Nov 2021, 4:40 AM
Cristian Baeza Jimenez
Cristian Baeza Jimenez - avatar