Posts

Showing posts from 2016
Hello everyone.Now we will discuss the relational operators. Relational Operators are generally used to define a test expression or a test condition.These are > , < , >= , <= , == , != . Note that == operator is used to check equality whereas = operator is used for assignment.There are also logical operators such as !,&& and || to negate a condition or to combine two conditions. A comma operators is used to combine several expressions together which get executed from left to right.It works as a punctuator. Ternery Operator/Conditional Operator-It is the replacement of simple Conditional operator.Its Syntax is as follows:- (condition)?True:False; Now coming to the Datatype conversions.These are of two types:- 1.Implicit 2.Explicit Implicit-In Implicit type conversion the compiler converts one data type to another automatically and it actually converts all the data upto the type of largest operand available in the expression & that is why implicit...
Hi! Today we will discuss Data type modifiers and Unary operators. Data type Modifiers- There are basically 4 datatype modifiers in C++-Signed,Unsigned,lond and short. As the name suggests, it modifies the basic datatypes and change their meaning to fit them in various situations precisely.All data types can be modified using datatype modifiers except void.For eg- unsigned int a;(It can store of positive integer which are not in range with normal integer datatype). The opposite is the function of signed int. Now long and short datatype modifiers change the amount of memory space given to a particular variable of that data type. for eg- long int will be given 4 bytes space in memory whereas int is of 2 bytes(in turbo c++). We can use these datatypes to make our program more precise which you will experience with time. There are Unary operators like -,++,-- in c++; ++ or -- operators are used to increment or decrement the value stored in a variable by one.These can be used be...
Image
Today we are going to discuss how to declare variables, what are cin,cout functions and we will also write a simple program to add two numbers and display it. The Syntax of declaring a variable is as follows- datatype vaiable name ; here,datatype can be int , float , char ,double ,  bool or void.(A variable of Bool datatype can store two possible values i.e. true or false,0 or 1,etc.).A variable name can be anything following the identifier's rules (discussed in previous posts).Every variable is associated with 2 values , r value and l value. r value is the datavalue and l value is the memory address of the variable. Example of variable declaration- float a; , int b; , etc. The variable declaration can be cascaded as follows if two or more variables have same datatypes. float a,b,c; Now,Coming towards the cin(console input) and cout(console output) operations. As the name suggests, cin (object of a class ifstream of iostream.h) and cout (object of a class ofstream o...
Hello Once Again Guys and Sorry for the delay. Now we are Going to continue where we left last time and you will get introduced to some new terms too. So we were at Literals, Let us remind it- Literals-A Literal is nothing But a token with Fixed Values.There are Mainly 5 types of Literals in C++ .They are- 1.Boolean Literal 2.Integer Literal 3.Character Literal 4.Float Literal 5.String Literal Now we will discuss these types a little bit. 1. Boolean Literal-It denotes a Logical expression which can only have two possible values ,0 or 1,true or false,yes or no,etc. 2. Integer Literal-As the name denotes,it can only take integer values(0-9) positive and negative.Its size depends on the Compiler but usually its around 2-4bytes. 3. Character Literal-It Stores Any Single character and the input must be given in Single Quotes. Every Character has its own Ascii code assigned to it. It's Size is usually 1 byte. 4. Float Literal-It has all the properties of an integer literal e...
Hello Again! Since We have Discussed the Hello World Program,Now its time to discuss the contents of a program. This was the Program we discussed:- #include<iostream> using namespace std; int main() {  cout << "Hello World"; return 0; } In this Program ,There is a Input-Output stream Header file(iostream) , namespace , main() function , datatype (int), return statement and the Algorithm(I Know The the Program doesn't Fully Justify the Word).We will Discuss All These Topics including Many Other Topics in Detail,But wait we need to go Step by Step.So Here We Are .... The First Thing You Need to Know About C++ is that it is a case sensitive and Compiler Based Language.Now Question is What is a Case Sensitive Language?A Language is Case Sensitive if it Differentiates Between Uppercase and Lowercase Letters i.e. It Doesn,t Consider Them Same. Compiler Based Language Means It Needs to Compile The Program before Executing it.A compiler generate Machine c...
Hello World! This is the basic program in any programming language and I want to start my blogging routine with this basic and simple program. This program doesn't use much of programming skills but tells us how far the technology has reached that a human created machine can respond back to us on the basis of our input. And nowadays computers could also respond physically and sensibly to human action as they are programmed to do so . Programming  is a basic term in computers and electronics but it has huge importance and significance if we want to acquire detailed Knowledge in the stream of computer science. Now Lets come back to our topic,our basic C++ or any other programming language programme, but I will use only c++ for coding as the blog name refers.Now Lets Start:- #include<iostream>//basic header file containing basic input/output operation functions using namesspace std; int main()//the program execution starts here { cout << "Hello World" ...