What are statements?

0 votes
164 views
zack mathews asked 13-Nov-2017 in programming by zack mathews

What are statements?

1 Answer

0 votes
Arti Mishra answered 18-Sep-2018 by Arti Mishra
“Statement”
In term of programming language, the statement is a command that the programmer has given to the computer system for performing the specific action. A Computer program is the collection of statements. 

"Flowchart  of Statement"

What are statements?
Types of Statement
  1. Simple Statement
  2. Compound statement
Simple Statement
  1.  assignment (=)
  2.  goto
  3.  return

Compound Statement
if-statement:
if(condition){…..} else {…..}
switch-statement:
switch (c) { case 'a': alert(); break; case 'q': quit(); break; }
Looping Statement
do-while loop
Syntax :- do {
 ………..
………..} while (condition);
for-loop:
for(initialization, condition, inc/dec)
{
………
………
}