Fund A 2

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

Pamantasan ng Lungsod ng Maynila

Intramuros, Manila

College of Engineering and Technology


Department of Computer Studies

Fundamentals of Problem Solving and Programming II

Hirao, Carmela Dawn V. Prof. Merlita Latip


BSCS-IT/4th Yr/Blk2

Source Code:
#include<stdio.h>
int star, hirao, mela;
void main()
{clrscr();
printf("enter variables: ");
scanf("%d", &mela);
starry();
getch();
}
starry()
{for(star=1;star<=mela;star++)
{
int hirao=1
while(hirao<=star)
printf("*");
printf("\n");
hirao++
}}
Source Code:
#include<stdio.h>
#include<conio.h>
int main()
{
int star,mela,dawn, height=0;
clrscr();
printf("Enter height of triangle: ");
scanf("%i",&height);
for(star=1;star<=height;star++)
{
for(dawn=height;dawn>star;dawn--)
printf(" ");
for(mela=1;mela<=star;mela++)
printf("* ");
printf("\n");
}
getch();
return 0;
}

You might also like