Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program to display number triangle

Posted By: Easy Tutor     Category: C Programming     Views: 15890

Write a program to display triangle as shown below.

1
2 2
3 3 3
4 4 4 4

Code for Program to display number triangle in C Programming

#include <stdio.h>
#include <conio.h>

void main(){
     int i,j,num;
     clrscr();
     printf("*****RightAngle Triangular Format*****\n");
     printf("Enter number : ");
     scanf("%d",&num);
     for(i=1;i<=num;i++){
         for(j=1;j<=i;j++){
             printf("%5d",i);
       }
       printf("\n");
        }
     getch();
}
  
Share: 


Didn't find what you were looking for? Find more on Program to display number triangle Or get search suggestion and latest updates.

Easy Tutor
Easy Tutor author of Program to display number triangle is from United States. Easy Tutor says

Hello Friends,

I am Free Lance Tutor, who helped student in completing their homework.

I have 4 Years of hands on experience on helping student in completing their homework. I also guide them in doing their final year projects.

I have share many programs on this website for everyone to use freely, if you need further assistance, than please contact me on easytutor.2ya [at the rate] gmail [dot] com

I have special discount scheme for providing tutor services. I am providing tutor service to students from various contries, currently most of my students are from United States, India, Australia, Pakistan, Germany, UK and Canada.

I am also here to expand my technical network to receive more opportunity in my career, make friends to help them in resolving their technical problem, learn and share my knowledge, If you like to be my friend, Please send me friend request.

Thanks,
Happy Programming :)

 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
Hani Alssarty from Malaysia Comment on: Oct 01
Q. it is required to compute the area of a triagle. the sides of the triangle are to be read in trough the keyboard by the user. write the pseudo code algorithm to solve the problem. draw the flow chart also?

i am beginner in this program ;)

Hani Alssarty from Malaysia Comment on: Oct 01
i have an assignment ,could anyone help me please?
the question is
write a program in C to determine the maximum and minimum values that can be stored in the various data types ?

View All Comments