0% found this document useful (0 votes)
75 views

C Exercises - Display The Pattern Like Right Angle Using An Asterisk - W3resource

This document contains a C code sample that uses nested for loops to print out a right angle pattern made of asterisks. The code prompts the user to input the number of rows, then uses two for loops - an outer loop that iterates through each row and an inner loop that prints an asterisk for each iteration to display the pattern before going to the next line.

Uploaded by

vvsprasad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views

C Exercises - Display The Pattern Like Right Angle Using An Asterisk - W3resource

This document contains a C code sample that uses nested for loops to print out a right angle pattern made of asterisks. The code prompts the user to input the number of rows, then uses two for loops - an outer loop that iterates through each row and an inner loop that prints an asterisk for each iteration to display the pattern before going to the next line.

Uploaded by

vvsprasad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

2/10/2021 C exercises: Display the pattern like right angle using an asterisk - w3resource

 w3resource (https://www.w3resource.com/index.php)

Sample Solution:

C Code:

1 #include <stdio.h>
2 void main()
3 {
4 int i,j,rows;
5 printf("Input number of rows : ");
6 scanf("%d",&rows);
7 for(i=1;i<=rows;i++)
8 {
9 for(j=1;j<=i;j++)
10 printf("*");
11 printf("\n");
12 }
13 }

Sample Output:

https://www.w3resource.com/c-programming-exercises/for-loop/c-for-loop-exercises-9.php 1/1

You might also like