Showing posts with label triangle image in c. Show all posts
Showing posts with label triangle image in c. Show all posts

Monday, April 6, 2020

Triangle Image in C

A simple program written by my friend and fellow software engineer Sir Ernel Fadriquilan. thank you very much Sir Ernel for sharing your code to us. This code will draw a Triangle Image using C language and using Turbo C for DOS compiler.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.
My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com
My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.mindshaperspublishing.com/

https://www.unlimitedbooksph.com/


Program Listing

triangle.c

#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main(){
int gd = DETECT ,gm;
initgraph(&gd,&gm,"c:\\turboc3\\bgi");
line(300,150,210,300);
line(300,150,390,300);
line(210,300,390,300);
getch();
}



Wednesday, June 18, 2014

Triangle Image in C


In this article I will show you how to write a program using C as your programming language to show an image of an triangle. We can accomplish this by using three for looping statement to repeat the display of the asterisk symbol over our screen. The code is very simple to understand and easy to learn from it I hope you will find my work useful.

Thank you very much.



Sample Output of Our Program

Program Listing

#include <stdio.h>
#include  <stdlib.h>

main()
{

int a=0,b=0,c=0,n=15;

printf("\n\n");
printf("\t  TRIANGLE");
printf("\n\n");

for(a=1;a<=n;a++)

      {

              for(c=1;c<=n-a;c++)

              {

                      printf(" ");

              }

              for(b=1;b<=(2*a)-1;b++)

              {

                      printf("*");

              }

              printf("\n");

      }
printf("\n\n");
system("pause");

}