Sunday, June 29, 2014

Convert any number to word

Q. Write a C program to convert any number to words, for example if 
user entered number = 45764
then output = Four Five Seven Six Four

Ans.

Friday, June 13, 2014

Comparison Million Billion Trillion - Lakh Crore Kharab Series

In daily life we are many time confused about the equality of differ type number unit as million,billion,trillion v/s lakh,crore,kharab etc.
So today let's now knowing about How much million in Lakh and whether a billion is das lakh or ek Arab(i.e. simply Arab).

Tuesday, June 3, 2014

Convert Any Digital Number Value In Words

Q. Write a C program that convert any digital number value in worlds as:

User entered value: 895484
then output in words as:
Eight Lakh Ninety Five Thousand Four Hundred Eighty Four

Ans.

Thursday, May 15, 2014

Continuous Vertical Number Pyramid

Q. Write a C program to print the following continuous vertical number pyramid design as:

1
2  7 
3  8  13
4  9  14  19
5 10  15  20  25

Ans.

Thursday, April 3, 2014

Tuesday, April 1, 2014

Nested 2 Types Symbol Pyramid

Q. Write a C program to print the following nested 2 types different symbol pyramid as:

@
#
@@
##
@@@
###

Ans.

/*c program for nested 2 types different symbol pyramid*/
#include<stdio.h>
int main()
{
 int num,r,c,z;
 printf("Enter Maximum Loop Repeat No. : ");
 scanf("%d", &num);

 for(r=1; r<=num; r++)
 {
  for(c=1; c<=2; c++)
  {
   if(c%2==0)
   {
    for(z=1; z<=r; z++)
       printf("#");
   }
   else
   {
    for(z=1; z<=r; z++)
       printf("@");
   }
   printf("\n");
  }
 }
 getch();
 return 0;
}


/*************************************************************

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


Figure: Screen shot for Nested 2 Types Symbol Pyramid C Program



Related Programs:

Wednesday, March 26, 2014

Nested Number Character Pyramid

Q. Write a C program to print the following nested number-character pyramid/pattern as:

A
1
BB
22
CCC
333

Ans.

/*c program for nested number character pyramid*/
#include<stdio.h>
int main()
{
 int num,r,c,z,n=1;
 char ch='A';
 printf("Enter Maximum number : ");
 scanf("%d", &num);

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


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


Output for Nested Number Character Pyramid C program
Figure: Screen shot for Nested Number Character Pyramid C program


Related programs:

1. Nested same Symbol Pyramid as:

   #
   #
   ##
   ##
   ###
   ###

2. Nested Differ Symbol Pyramid as:

   @
   #
   @@
   ##
   @@@
   ###

3. Nested Equal same-equal Pyramid as:
   
   @
   @
   ##
   ##
   @@@
   @@@

4. Nested Equal Number Pyramid as:

   1
   1
   22
   22
   333
   333

5. Nested Differ Character Pyramid as:
   
   A
   A
   BB
   BB
   CCC
   CCC