19th Dec 2018, 9:23 PM
Md. Asiful Hoque Prodhan
Md. Asiful Hoque Prodhan - avatar
2 Answers
+ 1
#include <stdio.h> void main() { int i,j; // First loop, loops the second(nested) loop 10x for (i=0;i<10;i++) { //second(nested) loop, loops 10x for (j=10;j>0;j--) { // print till j==i and breaks the loops printf("*"); // i counts positive // j counts negative // j == i = 50 (break loop at half of 100 since the first loop counts positive and second(nested) loop counts negative which results 50 from the original 100) // output is 50 + 1 = 51 x * will be printed if (j==i+1) break; } } } Hope I'll explained it wellšŸ‘
19th Dec 2018, 10:16 PM
šŸŒ“Vincent BergeršŸŒ“
šŸŒ“Vincent BergeršŸŒ“ - avatar
0
šŸŒ“Vincent BergeršŸŒ“ you are wrong! This code will print 10+9+8+7+6+5+4+3+2+1=55 stars (*)
27th Dec 2018, 3:18 PM
Md. Asiful Hoque Prodhan
Md. Asiful Hoque Prodhan - avatar