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

cs302 Solved Quiz

estion # 1 of 10 ( Start time: 03:03:55 PM )  Total Marks: 1    Divide-by-32 counter can be acheived by using   Select correct option:   Flip-Flop and DIV 10  Flip-Flop and DIV 16   Flip-Flop and DIV 32  DIV 16 and DIV 32 Question # 2 of 10 ( Start time: 03:05:20 PM )  Total Marks: 1   The counter states or the range of numbers of a counter is determined by the formula. (“n” represents the total number of flip-flops)   Select correct option:   (n raise to power 2)  (n raise to power 2 and then minus 1)  (2 raise to power n) (2 raise to power n and then minus 1) Question # 3 of 10 ( Start time: 03:06:36 PM )  Total Marks: 1   A 4- bit UP/DOWN counter is in DOWN mode and in the 1010 state. on the next clock pulse, to what state does the counter go?   Select correct option:   1001  1011  0011  1100 Question # 4 of 10 ( Start time: 03:07:37 PM )  Tot...

cs403 GDB Solution 2016

cs403 GDB 2016 For more discuss and ask question join this group   https://www.facebook.com/groups/143792885956764/ Posted By : Tahir Siddiqui(Mani)  Total Marks                                   5 Starting Date Wednesday, July 27, 2016 Closing Date Thursday, July 28, 2016 ...

MID TERM 2016 Spring Result Announced

Result has been Announced Check  ur lms Go LMS #MAni