63 : C Program to display triangle on numbers 1 to 15 sequence 11

Check out the complete list of c-programs : C Program List    





C program that displays a number pyramid, with incremental numbers from 1-to-15.

This can be achived using 2 nested for loops.

 1 

 2  3 

 4  5  6 

 7  8  9  10 

 11  12  13  14  15







/*
 * 1000+ C programs + tutorials
 *
 * 
 * 62_c_program_to_display_1_to_15_numbers_triangle_sequence_11.c
 *  
 *
 *
 *  Created on: Oct 22, 2014
 *  Author: Code2care.org
 */

#include 
//#include 

void main() {


//clrscr();


  int i,j;
  int count = 1;

 
  for (i = 1; i <= 5; i++)
  {
    for (j = 1; j <= i; j++) {
      printf(" %d ",count);
      count++;
 
  }
  printf("\n");
  }



//	getch();


}









The best way to learn C programming is to practice more and more of programs . Code2care C Programming tutorials provide 1000+ programs in C that you can study and become an expert in the language. Programs are divided into categories depending upon type and complexity.

BSc. IT, BSc. Computer Science, BSc. IT, MSc. IT, MSc. Computer Science, MCA, BTech IT & BTech Engineers may find these programs very useful.