Friday, 16 March 2012

Introduction




UNDERSTANDING OF COUT COMMAND


WRITE A PROGRAMME THAT DISPLAYS YOUR NAME

CODE for C++

#include<iostream.h>

void main()

{

cout<<"my name is umair iqbal"<<endl;

}

OUTPUT

DIFFERENT DATA TYPES



WRITE A PROGRAMME THAT DISPLAYS DIFFERENT DATA TYPES USED IN OOP
CODE for C++


#include<iostream.h>

void main()

{

int x=3;

float y=2.34;

char a='w';

cout<<"integer value is"<<endl<<x<<endl;

cout<<"float value is"<<endl<<y<<endl;

cout<<"character value is"<<endl<<a<<endl;
}
OUTPUT







UNDERSTANDING WITH endl AND "\n" COMMAND


WRITE A PROGRAMME THAT USES BOTH endl AND "\n" COMMANDS

CODE for C++

#include<iostream.h>

void main()

{

cout<<"i am student of 7th semester\n";

cout<<"my name is umair"<<endl;

}

OUTPUT


 





UNDERSTANDING WITH CIN COMMAND

WRITE A PROGRAMME THAT TAKES DATA FROM USER AND THAN DISPLAY IT

CODE for C++

#include<iostream.h>

void main()

{

int x;

cout<<"enter data"<<endl;

cin>>x;

cout<<"data is ="<<x<<endl;

}

OUTPUT

Thursday, 15 March 2012

Array

          
 In this programme you will store the multiple values in the array and and display it. this is very simple after you giving the header and main files you take an array of 5 elements. or for understanding you assume you take the 5 boxes and assign values in it. like you have 5 boxes in the kitchen for sugar,salt etc. and you fill these boxes when you have some salt,sugar etc.
                         In the same way you array's element is boxes and the values you place in it like numbers, constants or any other which you wana place in it.
                       this is the basic example of array in our daily life.Array is very helpful for long fuctions it reduced the size of c++ code and you save alot of space and time.

WRITE PROGRAMME THAT DISPLAYS AN  ARRAY

                          In this type of programme you take an array of any elements and after assigning the values in it using the for loop for displaying the element of an array. for loop is initialize from zero to any elements which you take in the array. if you assign more elements in the array your compiler give an error and the values can not be executed. after the for loop you simple place the variable which you take for for loop into the console output or cout. you will show all values you give to the compiler.

CODE for C++

#include<iostream.h>
void main()
{
int a[5];// Take an array of 5 elements.
a[0]=0;// store values in it
a[1]=1;
a[2]=2;
a[3]=3;
a[4]=4;
for(int x=0;x<=4;x++)//using for loop
cout<<a[x]<<endl;// placing variable for display
}

OUTPUT




WRITE A PROGRAMME THAT DISPLAYS ARRAY IN REVERSE ORDER
                                              In this programme all the programme is same as above but you make a little change in the for loop that you intialize the loop in reverse order see this code for understanding

CODE for C++

#include<iostream.h>

void main()

{

int a[5];

a[0]=0;

a[1]=1;

a[2]=2;

a[3]=3;

a[4]=4;

for(int x=4;x>=0;x--)

cout<<a[x]<<endl;

}
OUTPUT


WRITE A PROGRAMME THAT DISPLAYS EVEN INDEXED ELEMENTS OF ARRAY
In this code you again make some change the logic of for loop see code

CODE for C++
#include<iostream.h>
void main()
{
int a[6];
a[0]=0;
a[1]=1;
a[2]=2;
a[3]=3;
a[4]=4;
a[5]=5;
for(int x=0;x<6;x+=2)
cout<<"\n"<<a[x]<<"\n";
}
OUTPUT


WRITE A PROGRAMME THAT DISPLYS ODD INDEXED NYMBERS OF ARRAY
In this code you again make some change the logic of for loop see code
CODE for C++
#include<iostream.h>
void main()
{
int a[6];
a[0]=0;
a[1]=1;
a[2]=2;
a[3]=3;
a[4]=4;
a[5]=5;
for(int x=1;x<6;x+=2)
cout<<a[x]<<endl;
}
OUTPUT



thank you for reading my article

Wednesday, 14 March 2012

ARITHMATIC OPERATIONS

                                         
In the c++ programming arithmetic operations is suppose to the simple and basic programs in which you can perform the addition multiplication,subtraction,reminder and division.
this is like the ABC of C++ language. here you will see the basic operations you will understand.
you will download the microsoft visuall c++ 
and try to perform these basic operations

WRITE A PROGRAMME THAT COMPUTES THE SUM OF TWO INTEGERS.

In the addition you will first give the library or header file then add main function which control your programs and after giving values to variable you write the logical code or perform the operation which you wanna perform.

CODE for C++

#include<iostream.h>

void main()

{

int x,y,sum;

cout<<"enter first number"<<endl;

cin>>x;

cout<<"enter second number"<<endl;

cin>>y;

sum=x+y;

cout<<"result is ="<<sum;

}

OUTPUT




WRITE A PROGRAMME THAT COMPUTE THE SUBTRACTION OF TWO NUMBERS




In the subtraction you just change the operational sign and have perform the function of subtraction. you will se the code
CODE for C++
#include<iostream.h>

void main()

{

int num1,num2,sum;

cout<<"enter first number\n";

cin>>num1;

cout<<"enter second number\n";

cin>>num2;

sum=num1-num2;

cout<<" SUBTRACTION RESULT IS "<<sum<<endl;

}

OUTPUT











WRITE A PROGRAMME THAT COMPUTES MULTIPLICATION



In the subtraction you just change the operational sign and have perform the function of multiplication. you will se the code

CODE for C++

#include<iostream.h>

void main()

{

int num1,num2;

float answer;

cout<<"enter first number\n";

cin>>num1;

cout<<"enter second number\n";

cin>>num2;

answer=num1*num2;

cout<<" answer is "<<answer<<endl;

}
OUTPUT


WRITE A PROGRMME THAT COMPUTES DIVISION OF TWO INTEGERS



In the subtraction you just change the operational sign and have perform the function of multiplication. you will se the code

CODE for C++

#include<iostream.h>

void main()

{

int num1,num2;

float answer;

cout<<"enter first number\n";

cin>>num1;

cout<<"enter second number\n";

cin>>num2;

answer=num1/num2;

cout<<" answer is "<<answer<<endl;

}

OUTPUT

WRITE A PROGRAMME THAT COMPUTES REMINDER



In the subtraction you just change the operational sign and have perform the function to compute reminder. you will se the code

CODE for C++

#include<iostream.h>

void main()

{

int num1,num2;

float answer;

cout<<"enter first number\n";

cin>>num1;

cout<<"enter second number\n";

cin>>num2;

answer=num1%num2;

cout<<" reminder is "<<answer<<endl;

}

OUTPUT

if you have any confusion regarding this article please comment on it i will try to reply as soon as possible. thank you for reading my article.
                                           BYE

Monday, 12 March 2012

Resistance


The electrical resistance of an electrical element is the opposition to the passage of an electric current through that element. resistor is actually the conductor(in which the electric current flow is called conductor). there is free electron present in the conductor when the electron in the current passed into the conductor the electron present into the conductor which is freely move is strike and reduce the speed of electrons and in this way resistor drop the current speed.
The si unit of resistance is called ohm Ω.
                                                         if we increase the temperature of conductor. the free electron in the conductor move rapidly and the chance of collision increases is also increase and resistance value is large. if we decrease the temperature resistance value is also decreased. this is the simpler concept of resistance in otherwords we can says that resistance is the material which decrease the speed of current. the speed of current is due to the voltage (electromotive force) the resistor drop the voltage.
                                                         the difference between voltage and electromotive force is that when the voltage source is not connected to the circuit the force appear to its terminal is called electromotive force. when the source connected in the circuit is called voltage  

Saturday, 10 March 2012

Voltage

 is also called electromotive force(force to drive the current).it is a quantitative expression of the potential difference in charge between two points in an electrical field. The greater the voltage, the greater the flow of electrical current through a conducting or semiconducting medium for a given resistance to the flow. Voltage is symbolized by an uppercase italic letter V or E. The standard unit is the volt, symbolized by a non-italic uppercase letter V. One volt will drive one coulamb (6.24 x 1018) charge carriers, such as electrons, through a resistor.
                           In other words that voltage is a force which drive the
current. suppose that the current flow is like the water flow and the voltage is the force which drive the current/water. current always flow when it have some force(voltage). let us consider that we have two tanks of water having the equal/same water having hole in the tank and connected through pipe mean two tank having same water level connected through pipe. the water in the tank give no response and have the same water level. if we place one tank to a higher position and other in lower such as different potential difference. you will see that the water from higher potential/position flow to the lower potential/position. in the same way as a water current will flow only from higher potential to the lower potential. when the current in the zero potential difference(difference between two levels/points) no current flow through it.

Hope you have some idea about the volage thank you for reading my article

Current



Current

The rate of flow of charge with respect to time is called current

It is donated by I

The si unit of current is ampere (A)

Mathematically

Mathematically it is denoted by

I=Q/t

Q= charge

T=time

Dear friends for understanding the current you will think current flow is like the water flow we follow in all our concepts that current is like the water. Actually the current is the flow of charges and in the medium like wires metal which are inside the insulating cover allow the charge to flow through it and insulating cover is like a pipe which does not allow water to flow through it.



Example

The charge passed in the conductor is 10c in 5 sec. find the current in the conductor ?

Solution

As we know that

I=Q/t

I=10/5

I=2 A(ampere)


Thank you for reading my article.



Friday, 9 March 2012

Structure of Matter


structure of matter

 
  
Here i will give you the basic concept of structure of matter. the structure of matter is very simple to explain firstly you will see the diagram of structure of matter. you see that the matter is certain substance when we see its structure we will see its basic particles like atoms. All the matters is composed of atoms .
what is atom ?
this is a question which arise in everyones mind now I will tell you that the atom is the smallest unit of matters which have three basic particles called electron proton and neutron (other than these there also many sub particles but these three are the fundamental component of atom ).
Nucleus(collection of proton and nuetron) lies in the atom is in center of atom and electron is revolving around the nucleus in the same way as our earth revolving around the sun electron.
 
 
 
 
 





As we see in the diagram the centeral element of atom which consist of positively charge proton and have the neutrally charge neutron or we say that neutron have no charge in it.
neutron have no charge in it so it is not show in the diagram the positivly charge proton and negatively charge electron attract together and make the net charge is zero in an atom

 
 
 
LIKE CHARGE REPEL EACH OTHER AND UNLIKE CHARGE ATTRACT EACH OTHER
 
 
This is about the complete behavior of charges that the charges I will tell you in the 3 simple easy and interesting points
 
 
ELECTRONNEGATIVE CHARGE (-)
 
 
PROTON POSITIVE CHARGE(+)
 
 
NEUTRONNO CHARGE(NEUTRAL)
 

             If we place two electron closed to each other they are repel each other
    • If we place two proton closed to each other they repel each other
    • If we place one electron and one proton closed to each other they are attract each other
Dear friends i am not going in detail for the structure of matter i give you the basic overview of the structure of matter as my blogs name suggest it is all about the electronics so in the further article step by step i will going on the topics and techniques of electronics theorems laws and study the basic components their behaviour and many more         if you like my articles please comment and thank you for reading my article I try my best to improve my articles please give me your suggestion thank you again

Thursday, 8 March 2012

Electricity




   It is the form of energy which we obtain from the existance of charge particles such as electrons,protons either statically as an accumulation of charge or dynamically as a current





                                           first of all i would like to start from the basics concepts what is energy when he produced ? the answer of this question is very quite simple that when we charge any particle it have some energy for example if we will rubbed our both hands we feel heat in it the reason is simple when we rubbed the particle it have store charge in the same way when we have the particle like electron or proton which have excited in the have also stored charge in it. we define the electricity in the same way that the collection/accumulation of charge particles either they have static condition or dynamic condition like current. in simple words we have to say that the electricity is the condition of feeling excitement /thrilling.
                                        you are lucky to read the word electricity because some of underdeveloping countries public says to government to say that you use old fashioned lamp of oil because from now no electricity have to given to anyone we remove our electricity wires hehehehehe its just a joke subscribe this blog to read all articles about the electronics. please give your comments thank you bye

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Bluehost Review