C Programming

C Programming


How to make continuous number pyramid with Zero

Posted: 17 Feb 2015 08:46 AM PST

Q. Write a C program to make a continuous number pyramid with adding digit "Zero" as:

  1
  02
  003
  0004
  00005
  000006
  0000007
  00000008
  000000009

Ans.

/*c program for making a continuous number pyramid*/
#include<stdio.h>
int main()
{
 int r,c;

 printf("1\n");
 for(r=2; r<=9; r++)
 {
   for(c=1; c<=r; c++)
   {
      if(c==r)
         printf("%d",r);
      else
         printf("0");
   }
   printf("\n");
 }
 getch();
 return 0;
}

/***********************************************************
The output of above program would be:
***********************************************************/

Output of How to make continuous number pyramid  with Zero C Program
Figure: Screenshot for How to make continuous number pyramid
 with Zero C Program


You might also like:

  1. Big list of 98+ C Pyramid programs
  2. Latest pyramid programs list asked by user



Post a Comment

9lessons:Facebook Style Background Image Upload and Position Adjustment.

9lessons:Facebook Style Background Image Upload and Position Adjustment.

Link to 9lessons Programming Blog

Facebook Style Background Image Upload and Position Adjustment.

Posted: 16 Feb 2015 11:47 AM PST

I received many tutorial requests from my readers that asked to me how to design Facebook style ajax background image upload and position adjustment using Jquery. I have been published many tutorials about ajax image upload, this one is very interesting and it is a combination of many features. I has implemented this in Wall Script, this post will explain you how to design timeline HTML frame, CSS techniques and database design for background image system.

Facebook Style Background Image Upload and Position Adjustment.

Read more »


Post a Comment

9lessons:Facebook Remarketing for Better Advertisement Results

9lessons:Facebook Remarketing for Better Advertisement Results

Link to 9lessons Programming Blog

Facebook Remarketing for Better Advertisement Results

Posted: 09 Feb 2015 09:18 PM PST

Few days back we published an article called how to create an effective Facebook banner advertisements. This post will explain you how to use "re-marketing" feature on Facebook, this feature will help you to target product advertisements for recent visitors of your website. Please follow the Facebook remarketing setup process, I am sure this will improve your product sales.

Facebook Remarketing for Better Advertisement Results.

Read more »


Post a Comment

C Programming

C Programming


How To Design Taj Mahal Shape Pyramid

Posted: 01 Feb 2015 04:11 AM PST

Q. Write a C program to print the following Taj Mahal Shape pyramid as:

*
***
*****
*******
**
****
******
*******
******
****
**
*******
*****
***
*

Ans.

/*c program for Taj Mahal shape pyramid*/
#include<stdio.h>
int main()
{

 int r,c,w,x,y,z;
 for(r=1,z=1; r<=4; r++,z=z+2)
 {
   for(c=1; c<=z; c++)
       printf("*");
   printf("\n");
 }
 for(r=1,y=2; r<=3; r++,y=y+2)
 {
   for(c=1; c<=y; c++)
       printf("*");
   printf("\n");
 }
 for(r=1; r<=7; r++)
    printf("*");
 printf("\n");
 for(r=1,x=6; r<=3; r++,x=x-2)
 {
   for(c=1; c<=x; c++)
       printf("*");
   printf("\n");
 }
 for(r=1,w=7; r<=4; r++,w=w-2)
 {
   for(c=1; c<=w; c++)
       printf("*");
   printf("\n");
 }
 getch();
 return 0;
}

/**********************************************************
The output of above program would be:
**********************************************************/

Output of Taj Mahal shape pyramid source code C programming
Figure: Screen shot for Taj Mahal shape pyramid source code C program


You might also like:

  1. Big list of 98+ C Pyramid Programs
  2. Latest Pyramid Programs List asked by users


Post a Comment