10.12.2015

Continuous Rhombus Number Pattern

Q. Write a Number reverse program in C language as following pattern:

     1  2  3  4
     8  7  6  5
     9 10 11 12
    16 15 14 13

Ans.

/*c program for reverse number pattern rhombus*/
#include<stdio.h>
int main()
{

10.11.2015

3 Nested Number Pattern C Program

Q. Write a C program to make the following number pattern triangle program as:

     10 9 8 7 6 5 4 3 2 1 0
     10 9 8 7 5 3 2 1 0
     10 9 8 5 2 1 0
     10 9 5 1 0
     10 5 0
     5    

Ans.

Before you start to write down the source code of above number pattern program, carefully look the number pattern and divide it sub pattern as following:

     10 9 8 7 6 5 4 3 2 1 0
     10 9 8 7 5 3 2 1 0
     10 9 8 5 2 1 0
     10 9 5 1 0
     10 5 0
     5 

9.25.2015

Odd and Even Number Pattern Program In C

Q. Write a Odd and Even number pattern in C language as following:

    1
    2 4 6
    1 3 5 7 9
    2 4 6 8 10 12 14
    1 3 5 7  9 11 13 15 17

Ans.

/* even odd number pattern program in c*/
#include<stdio.h>
int main()
{

9.18.2015

Character Pattern Program In C

Q. Write a character pattern program in C as following:

    ABCDEDCBA
    ABCDCBA
    ABCBA
    ABA
    A

Ans.

Before we start to source code of above character pattern program, if you look carefully on above character pattern, there are 2 character pattern shows as:

    ABCDEDCBA
    ABCDCBA
    ABCBA
    ABA
    A

so just make above 2 character pattern and merge them, you are done. Cheers!!
Let's start the coding in C.

/*character pattern program in C*/
#include<stdio.h>
int main()
{
  char r,c,ch,h;
  printf("Enter any charactr : ");
  scanf("%c", &ch);
  if(ch>='a' && ch<='z')
     ch=ch-32;

9.12.2015

Perfect Number In C Using Function

Q. Write a C program to identify the user entered number is perfect number or not.

Ans.

/* perfect number in c using function program */
#include<stdio.h>
int perfect(int  );
int main()
{

9.10.2015

Number Pattern In C

Q. Write the following number pattern program in C language as:

    123454321
    1234321
    12321
    121
    1

Ans.

Before we start to write the source code of above number pattern program, if you look carefully on above pattern, there are 2 number pattern shows as:

8.08.2015

Character Triangle Shape C Program

Q. How to design a character triangle shape C program as:

 ABCDE
 ABCD
 ABC
 AB
 A

Ans.

/*Character Triangle Shape C Program*/
#include<stdio.h>
int main()
{

4.18.2015

Print Rectangle Pattern Program In C

Q. Print the rectangle pattern program in C as following design:

  1111111
  1222221
  1233321
  1234321
  1233321
  1222221
  1111111

Ans.

  1111111
  1222221
  1233321
  1234321
  1233321
  1222221
  1111111

Tips/Tricks:  Each color group represent a loop in rectangle pattern program as the below                              source code written.

/* source code for print the rectangle pattern program*/

#include<stdio.h>
int main()
{

3.05.2015

Floyd Algorithm Character Pattern In C

Q. WAP (Write A Program) to making the floyd algorithm character pattern in C as:

  A
  BC
  DEF
  GHIJ
  KLMNO

Ans.

/*c program for floyd algorithm character pattern*/
#include<stdio.h>
int main()
{

3.03.2015

How To Make Half Rhombus Shape Number Triangle

Q. How to make half rhombus number triangle as:

  5
  456
  34567
  2345678
  123456789
  2345678
  34567
  456
  5

Ans.

/*c program for half rhombus number triangle*/
#include<stdio.h>
int main()
{
 int r,c,j,num,n;
 printf("Enter Any Number : ");
 scanf("%d", &num);

2.17.2015

How to make continuous number pyramid with Zero

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;

2.01.2015

How To Design Taj Mahal Shape Pyramid

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()
{