0% found this document useful (0 votes)
6 views1 page

HW 2

This document contains a C program that prompts the user to enter a number of rows and then prints a right-aligned triangle of asterisks based on that number. The program uses nested loops to manage the spacing and the printing of asterisks. It includes basic input and output functions from the standard library.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

HW 2

This document contains a C program that prompts the user to enter a number of rows and then prints a right-aligned triangle of asterisks based on that number. The program uses nested loops to manage the spacing and the printing of asterisks. It includes basic input and output functions from the standard library.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

/*hw 2

#include<stdio.h>

int main()

int i,j,row,gap;

printf("Enter the value of row :");

scanf("%d",&row);

for(i=1;i<=row;i++)

for(gap=i-1;gap<row;gap++)

printf(" ");

for(j=1;j<2*i;j++)

printf("*");

printf("\n");

*/

You might also like