Skip to main content

Dev c++ 2nd class

For more discuss and ask question join this group
 
Solved  By : Tahir Siddiqui(Mani)


Dev c++ 2nd  lecture :

Structure of a program :


A computer program is a sequence of instructions that tell the computer what to do.

 

Statements and expressions
The most common type of instruction in a program is the statement. A statement in C++ is the smallest independent unit in the language. In human language, it is analogous to a sentence. We write sentences in order to convey an idea. In C++, we write statements in order to convey to the compiler that we want to perform a task. Statements in C++ are terminated by a semicolon.
There are many different kinds of statements in C++. The following are some of the most common types of simple statements:

int x;
x=5;
x=y;

 

int x is a declaration statement. It tells the compiler that x is a variable. In programming, a variable provides a name for a region of memory that can hold a value that can vary. All variables in a program must be declared before they are used. We will talk more about variables shortly.
x = 5 is an assignment statement. It assigns a value (5) to a variable (x).


std::cout << x

std::cout << x; is an output statement. It outputs the value of x (which we set to 5 in the previous statement) to the screen.


Comments

Popular posts from this blog

IT Intern (Microsoft Product)

For more discuss and ask question join this group   https://www.facebook.com/groups/143792885956764/ Solved   By : Tahir Siddiqui(Mani) BC-140201235@Vu.edu.pk Job Description We offer Internship in IT 03 months Unpaid internship Responsible for Managing IT Products/Services. Maintains relationships with clients by providing support, information, and guidance. Good presentation skills. Good oral & written communication knowledge of MS Office 50%. Traveling Required Team Work Candidate must have a Motor Bike and laptop. Fresh candidates are encouraged to apply. Job Details Industry: Information Technology ...

cs304 Assimgt 2 2016

Assignment No. 02 Semester: Spring  2016 Object Oriented Programming – CS304 Total Marks: 20 Due Date: July 21, 2016 Objectives: To get a hands on experience of using existing class as base class and implement inheritance. Instructions: Please read the following instructions carefully before submitting assignment: It should be clear that your assignment will not get any credit if: §   The assignment is submitted after due date. §   The assignment is submitted via email. §   The assignment is copied from Internet or from any other student . §   The submitted assignment does not open or file is corrupt. §   It is in some format other than .cpp (Code File). Note: All types of plagiarism are strictly prohibited. For any query about the assignment, contact at CS304@vu.edu.pk Case Study With the technological innovation, th...