Aslam.o.Alikum Students.....Today lecture is about
Data Types
Data Types:-
Data Types tells a variable which type of data is stores in the variable.like integer data,character data,number data,frictional data,large data and small data.
you can easily understand with the concept of data types according to above pic.
These are the following Data Types in programming languages:-
- int
- char
- float
- double
- long
- long double
- bool
In above pic you can easily understand about data types.
First of all we will discuss about
int.
Int Data Type:-
int is pronounced from integer.you know that what is integer data?So int data type is used to store the integer data.
Examples of integer data:-
1,11,21,31,41,-56,-34.....etc.
Char Data Type:-
char is pronounced from character.And you know that what is character data type?So char data type is used to store character data and special symbols like @,#,$,%.
Examples of char data:-
a,A,K,k,f,G,$,@,&.......etc.
Note:-
The value of a character variable will always stored in single quotation marks.
For Example char a='A';
here we define a char type variable and assign value 'A' to it.
Float Data Type:-
float data type is used to store the floating point or fractional values.And you know that what is fractional or floating point values.
Examples of float data:-
1.1,34.56,123.456........etc.
Student these are some data types which are more used in C++.So from today we will start proper programming practice.I shall produce code of program itself and the pictures of code and output of code will upload on this page through which you will seek better programming INSHA ALLAH....
And don't worry about other concepts i shall provide every concept of this language but with a schedule of time.Today i will start proper programs. And give the ideas of those topics which we not discuss now in future.......................!
I shall code a program in my PC and upload the code and the output of program and also give a brief information about the working of program.Mean's what will program do and what we are expecting from it.
All the codes of C++ are run on Microsoft Visual C++ 6.0.
LET'S START STUDENTS PROGRAMS
Program No.1
Write a program which declare two integer type variables and show their values.
OUTPUT:-
In above program i define 2 variable one is 'a' and second is 'b' assign value 5 to a and 4 to b.
and show their values by using "cout" statement."cout" statement is used to show the message or value on the output screen or window.The message which you want to show as same on output window you will write it in double quotation marks(" ").If you want to show the value of variable on output screen you will write the variable name in(<< here you write the name of variable<<).