Distinctions about C and C++ Programming and the Loop Syntax

Asked By 0 points N/A Posted on -
qa-featured

What is the difference between C and C++?

And also tell me the syntax of for loop?

SHARE
Best Answer by Cruise berry
Best Answer
Best Answer
Answered By 0 points N/A #122730

Distinctions about C and C++ Programming and the Loop Syntax

qa-featured

Hello Aniee

This is a good question. Your mentioned is between C and C++.

"C" is a language of Computer. Some of programming language is including the "C". It is created by experts in 1972. The lots of computing program indicate it. As external and internal it works very important way. The other way it is a Capital Letter of the English Language (pronounced). UNIX, PHP, Java and some other soft will operate this as a code.

 

C++ is also a programming language that server Website and Domain internal programs software. All applications of the relating website programming C++ are most powerful soft.

About the Syntax: it is an English Grammar Language program. It will not provide Computer Language.

Answered By 0 points N/A #122731

Distinctions about C and C++ Programming and the Loop Syntax

qa-featured

 

The main difference in C and C++ are:
C++ in upgraded version of C language.This means you can do any kind of work in C++ which also support C Language.
C++ is object oriented language.we can declare classes in C++ but not in C language.
C++ support overloading while C language do not support it.
We can not delete commands in C language and C++ language do not allowed undeclared functions.
In C language we write scanf and printf for input and output where as in C++ we use cin>> and cout<<.
 
The Syntex for for loop is 
for(i=0;i<=10;i++)
where i is any integer and this loop will execute from i=0 to i=10
 
Answered By 0 points N/A #122733

Distinctions about C and C++ Programming and the Loop Syntax

qa-featured

Broadly Speaking, The difference between C and C++ is the approach that both these languages use to solve any problem i.e

C is procedural language and C++ is an Object Oriented language. Originally, C++ was based on C and maintains much of the functionality of C. But there are a lot of DIFFERENCES too between these languages. For example

1. C does not provide Boolean Type while C++ has it.

2.  C++ has a much larger library than C.

and etc.

Syntax of  "for loop"  is same for C and C++:

                                        for ( init-expr; test-expr; decrement/ increment-expr) statement

  • init-expr, if it exists, is executed. Typically this initializes one or more counters, and may also declare them as well.
  • test-expr is evaluated. If it evaluates to True or is missing then loop body is executed. Otherwise the for loop exits.
  • increment-expr is executed if it exists. Typically this increments/decrements one or more counters.  

NOTE: If you have single statement to be executed after for-loop then use of Curly Brackets, {}, is optional. In order to execute group of statements after for-loop the statements should be enclosed in curly brackets.

 

Related Questions