Saturday, August 16, 2014

How To Design A Number Rhombus Pattern C Program

Q. Write a C program to print the following number rhombus pattern design as:

      1 1
     2   2
    3     3
   4       4
  5         5
   4       4
    3     3
     2   2
      1 1

Ans.

Friday, August 15, 2014

How To Download All Your Google Data As Gmail, Blogger, Youtube etc

Download All Your Google Data with single click - Google Takeout
Figure: Google product list-download a copy
Today anyone keep his/her data on the web (i.e. clouding). Clouding has its own pro and cons. 

As a advantage of clouding, a authorized person can access his/her personal data any time and any location with a single click. But its major disadvantage is dependency at clouding.

What happen if clouding server is crash, there are no-backup, you can lost all your data and there are no options of restore.





Monday, August 11, 2014

How to Make a Continuous Diagonal Number Pyramid C program

Q. Write a C program to print the following continues odd reverse number pyramid pattern as:

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

Ans.

Sunday, August 10, 2014

What is Data Type In C

In the C Programming Language, Data Types refers to an extensive system for declaring variable of different types. 
A data types tells the following things about the related variable:


Saturday, August 9, 2014

Number Triangle Pattern C Program

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

0
101
21012
3210123
432101234
54321012345

Ans.

Thursday, August 7, 2014

How to Add Binary Numbers In Computer

What is Binary Number System in Computer?
In binary number system, there are only two number available to represent the numeric values says 0 and 1.
There are 2 symbol (i.e. 0 and 1) used in binary number system, so it is also called base-2 numerical system.

Example of Binary Number:
011, 1110, 101001, 111001011

Before we start that how to add binary numbers, first of all you should know that what will be values of decimal in binary, so below tables give you reference or cross check that binary number addition is correct or incorrect.



S.No. Decimal Binary
1. 0 0
2. 1 1
3. 2 10
4. 3 11
5. 4 100
6. 5 101
7. 6 110
8. 7 111
9. 8 1000
10. 9 1001
11. 10 1010
Table: Comparison of Decimal and Binary Numbers

How to add binary number in computer?
It is simple as we add the decimal number. keep in mind the following trick to addition of binary numbers as:
Rules No. Condition Result Remark
1. 0 + 0 0 -
2. 0 + 1 1 -
3. 1 + 0 1 -
4. 1 + 1 0 carry 1 to next column
5. 1 + 1 + 1 1 carry 1 to next column
Table: Binary number addition rules

Let's we understand the how to add binary number in computer through an example as:
Let's we want to add two decimal number 8+4=12.
When we convert these number decimal to binary, we get:
8 in Binary 1 0 0 0 and,
4 in Binary 1 0 0
Below figure shows the step by step with explanation that how to add these binary numbers:

How to add two binary numbers in computer
Figure: How to add two binary numbers in computer
You can cross check the your answer, through convert the binary value to decimal and add them as we are doing in daily life, after that compare the both values if both are equal, thump's up friend, you  done it, Cheers!!
Four your practice, add the following binary numbers:
(for your  cross check binary addition result, i also write down answer.)

   1 0 1 0 0                      0 0 1 1 1 0                         1 1 0                      1 1 0 0 1 1 1
+ 0 1 1 0 1                  + 1 0 0 1 1 0                       + 1 1 0                  + 1 0 1 1 0 1 1
------------------                 --------------------                ------------                ---------------------
 1 0 0 0 0 1                     1 0 1 1 0 0                      1 1 0 0                   1 1 0 0 0 0 1 0
------------------                  --------------------               ------------                 --------------------


You might also like:

  1. How to convert Decimal number to Binary numbers in Computer?

Saturday, July 26, 2014

Computer data storage Unit with Comparison their values

Q. What is data storage unit in computer? Compare the storage unit as bit, nibble, byte, kilobyte, megabyte, gigabyte, terabyte, pitabyte, exabyte and so on.

Ans. 

Storage unit is used to measurement of data. In other word the capacity of storage medium is measured in bytes.

There are various storage unit(smallest & biggest) available in the modern computer era. The smallest storage unit is bit. bit is also called binary digit(b) or simple "binary". Hence the value of bit is 0 or 1.

The following table shows the list of computer data storage unit as smallest to biggest:

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

Monday, February 17, 2014

Square Number Triangle

Q. Write a C program to print the following square number triangle as:

1
1 4 9
1 4 9 16 25
1 4 9 16 25 36 49
1 4 9 16 25 36 49 64 81

Ans.

/*c program for square number triangle*/
#include<stdio.h>
int main()
{

 int r,c,q=1;
 for(r=1; r<=5; r++,q=q+2)
 {
  for(c=1; c<=q; c++)
     printf(" %d",c*c);
  printf("\n");
 }
 getch();
 return 0;
}

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

Output of square number triangle C program
Figure: Screen shot for square number triangle C program

Related Program:


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

Number Pyramid Pattern

Q. Write a C program to print the following square number pyramid pattern as:

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

Ans.

/*c program for square number pyramid pattern*/
#include<stdio.h>
int main()
{
 int r,c,s1=1,s2=15;
 for(r=5; r>=1; r--)
 {
  if(r%2==0)
  {
    for(c=1; c<=r; c++,s2--)
       printf(" %d",s2);
  }
  else
  {
     for(c=1; c<=r; c++,s1++)
       printf(" %d",s1); 
  }
  printf("\n");
 }
 getch();
 return 0;
}

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


Output of square number pyramid pattern C program
Figure: Screen shot for square number pyramid C program

Number Triangle Pattern

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

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

Ans.

/*c program for triangle number pattern*/
#include<stdio.h>
int main()
{
 int num,r,c,q=1;
 for(r=1; r<=5; r++,q=q+2)
 {
  for(c=1; c<=q; c++)
     printf(" %d",c);
  printf("\n");
 }
 getch();
 return 0;
}


/**********************************************************
The output of above program would be:
***********************************************************/
Output of number triangle pattern C program
Figure: Screen shot for number triangle pattern C program

Related Programs:


1
1 4 9
1 4 9 16 25
1 4 9 16 25 36 49
1 4 9 16 25 36 49 64 81

Thursday, February 6, 2014

Equal Character Triangle

Q. Write a C program to print the following equal character triangle pattern as:

A
BAB
CBABC
DCBABCD
EDCBABCDE

Ans.

/*c program for Equal Character Triangle pattern*/
#include<stdio.h>
int main()
{

 char ch,r,c;
 printf("Enter Any Character : ");
 scanf("%c", &ch);
 if(ch>='a' && ch<='z')
    ch=ch-32;
 for(r='A'; r<=ch; r++)
 {
   for(c=r; c>='A'; c--)
      printf("%c",c);
   for(c='B'; c<=r; c++)
      printf("%c",c);
   printf("\n");
 }
 getch();
 return 0;
}

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


Output of equal character triangle C program
Figure: Screen shot for equal character triangle C program


Related Program:

Equal Number Triangle C program:

1
212
32123
4321234
543212345

Equal Number Triangle

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

1
212
32123
4321234
543212345

Ans.

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

 int num,r,c;
 printf("Enter Any Number : ");
 scanf("%d", &num);
 for(r=1; r<=num; r++)
 {
   for(c=r; c>=1; c--)
      printf("%d",c);
   for(c=2; c<=r; c++)
      printf("%d",c);
   printf("\n");
 }
 getch();
 return 0;
}

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


Output of equal number triangle pattern C program
Figure: Screen shot for equal number triangle C program

Related Programs:

Equal Character Triangle as:

A
BAB
CBABC
DCBABCD