Tagged: asterisk triangle program

2

Program to display right angled triangle of star (asterisk)

Below the program in C that will display right angled triangle of star/asterisk. The program will use for and while loop to display the star/asterisk on the screen. Expected Output * ** *** Here is the code, #include<stdio.h> #include<conio.h> void main() { int i, counter; clrscr(); for(i=0; i<3; i++) { counter = 0; while(counter <= i){ printf(“*”); counter++; } printf(“\n”); } getch(); } This C Program is brought you by LearnCOnline.com

FREE C Cheatsheet - Speed Up Your C Programming.

FREE C Cheatsheet - Speed Up Your C Programming.

Download a 7-page free cheat sheet for easy and quick access to C Concepts, Snippets, and Syntax.

Thank you! Check you inbox and access your cheat-sheet