Latest Movie :
Home » » C Program to Print a Sentence

C Program to Print a Sentence

{[['']]}

[PROGRAMS]


C Program To display the triangle using *, numbers and character

Write a C Program to print half pyramid as using * as shown in figure below.
*
*   *
*   *   *
*   *   *   *
*   *   *   *   *

Answer:
----------------------------------------------------------------
#include <stdio.h>
 int main() { 
int i,j,rows;
printf("Enter the number of rows: ");
scanf("%d",&rows);
 for(i=1;i<=rows;++i) {
  for(j=1;j<=i;++j) {
      printf("* "); 
   } 
   printf("\n"); 
  }
  return 0;
}
----------------------------------------------------------------


2. C++ programming

3. Java programming

4. PHP programming

5. Pearl programing


Share this article :

Post a Comment

poower
 
Support : Creating Website | mayank | Mas Template
Copyright © 2009. Auditor Link - All Rights Reserved
Template Created by Creating Website Published by salman
Proudly powered by videos