dry run for the given pattern code ?

+2 votes
asked Sep 23, 2019 by anonymous
/* Dry run for the given star pattern code with explanation of each line in brief*/


  int main(){

    char *str="*******************";

    int i,j, rows;

    printf("Enter the number of rows\n");

    scanf("%d", &rows);

    for(i = 0; i < rows; i++){

    printf("%*.*s\n", rows, i+1, str);


   return 0;


1 Answer

0 votes
answered Oct 3, 2019 by Uzair Anwar (360 points)
1)first of all you will enter a number .

2)you will print space and *of size i from str

3)then print star of i which is increase.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.