C examples for Statement:for
Use nested loops to produce a pattern based on letter 2
A BC DEF GHIJ KLMNO PQRSTU
#include <stdio.h> int main(void){ char c = 'A'; for (int i = 1; i < 7; i++){ for(int j = 1; j <= i; j++){ printf("%c", c++); // print and THEN increment c }//from w ww .j a v a2 s. c o m printf("\n"); } return 0; }