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

Saturday, February 1, 2014

Character Pyramid

Q. Write a C program to takes the last character by user and print the following character pyramid as:
(if user input : j), then output would be like as:

A
ABA
ABCBA
ABCDCBA
ABCDEDCBA
ABCDEFEDCBA
ABCDEFGFEDCBA
ABCDEFGHGFEDCBA
ABCDEFGHJHGFEDCBA
ABCDEFGHGFEDCBA
ABCDEFGFEDCBA
ABCDEFEDCBA
ABCDEDCBA
ABCDCBA
ABCBA
ABA
A

Ans.

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

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

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


Output of character pattern pyramid C program
Figure: Screen shot for character pyramid C program

Friday, January 31, 2014

Comparison of Computer Generation

There are five computer generation, the following table summarise all main features comparison of related generation as:


Features First Generation Second Generation Third Generation Fourth Generation Fifth Generation
Period 1946-1959 1959-1965 1965-1971 1971-1985 1985-now
Electronic Item Vaccum Tube Transistor Integrated Circuit Microprocessor VLSIC
Language Machine Assembly High Level Language High Level Language High Level Language
Storage Punch Card Magnetic Tape Internal Memory Internal Memory Internal Memory
Example ENIAC IBM-700, ATLAS PDP Series's computer, CDC-1700 IBM-PC, ZX-SPECTRUM Super Computer, Robot
Table: Comparison of Computer Generation with its features

Fifth Computer Generation

The timing of Fifth Computer Generation: 1985 - now

The main characteristic of fifth generation computer is as following:


  • Fifth generation computers uses Very Large Scale Integrated Circuit (VLSIC) technique.
  • These generation have Artificial Intelligence (AI), hence these computes can take the self decision.
  • These generation used in scientist laboratories.
  • These computer is too much expensive and processing speed of too much high so these types computers also knows Knowledge Information Process System (KIPS).
  • Example of Fifth generation computers: Super Computers, Robot etc.

Fourth Computer Generation

Fourth Generation Computer Timing: 1971-1985

This generation computers are more advanced to other its previous generation computers.
The scientist Ted Haff makes the first microprocessor of the world in 1971.

The main characteristics of fourth generation computers is as following:


  • This generation computers used the microprocessor.
  • This generation computer used many type high level language like as BASIC, COBOL, PASCAL etc.
  • The storage capacity is too much of these generation computers.
  • The processing speed is too fast compared to previous generation computers. These computers speed counting in microsecond, nanosecond and picosecond and corresponding lower unit.
  • These computer size is small and easy to operator and carry, hence this generation computers are too much famous.
  • Example of fourth generation computers: IBM-PC, ZX-SPECTRUM etc.

Third Computer Generation

Third generation of computer was introduced when there were comes IC(Integrated Circuit).
Integrated Circuit is a powerful electronic thing that was makes to merging of many transistor.
The main characteristic of third generation computers as following:


  • The third Generation computer used IC that was more powerful to transistor.
  • The third Generation computer uses High Level Language (HLL).The first High Level Language is FORTRAN.
  • First time, the third Generation computers are used the internal memory for storage the data.
  • This generation computers are small, easy to operator, easy to carry and processing speed is more comparison to second generation computer.
  • Example of third Generation computers: PDP series's computer, CDC-1700

Second Computer Generation

"A small  but powerful discovery change all the thing of the world."

The above sentence fit in the second computer generation, when transistor comes.
Transistor was invented by William Shockly and his team at the Bell laboratories.
Transistor is an electronic item that was make semi-conductor metal. As compare of working capacity of transistor with Vaccum Tube is too much so its replaced Vaccum Tube and its second generation of computer comes.

The important features of second generation computer as following:

  • The second generation computer uses Transistor.
  • The second generation computer works on Assembly language i.e. it is mnemonic codes that was easy to write and understand compare to machine language code.
  • The second generation computer uses Magnetic Tape for storage the data.
  • The second generation computers are small, easy to carry, easy to operator comparison to first generation computer.
  • Example of the second generation computers: IBM-700, ATLAS

First Computer Generation

The first computer comes since 1946 named ENIAC. ENIAC stand for Electronic Numerical Integrator And Calculator. ENIAC invented by J.P.Eckert and J.W.Mauchiy. The characteristic of first computer generation is as following:

  • The first generations computers used Vacuum Tube or Diode Valve.
  • The first generations computers works on the machine language i.e. all working is done with 0 and 1.
  • The first generation computers used magnetic drums or punch card for storage the data.
  • The first generation computers is too large in size so too difficult to transport for one palace to another.
  • The first generation computers consumes too much electricity.
  • Example of first generation computers: UNIVAC, ENIAC

Wednesday, January 29, 2014

Decrease Character Pyramid

Q. Write a C program to print the following decrease character pyramid as:

EEEEE
DDDD
CCC
BB
A

Ans.

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

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

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


Output for decrease character pyramid C program
Figure: Screen shot for decrease character pyramid C program