C++

A collection of 19 Articles

Compile C program with gcc compiler on Bash on Ubuntu on Windows 10

The GNU Compiler Collection (GCC) is a compiler system produced by the GNU Project supporting various programming languages. You can compile a C program by using the gcc command in Windows 10 Bash on Ubuntu. 1.Enable Bash on Ubuntu on Windows 10 If you don't have a enable Ubuntu ...

Introduction to C++ - C++ Programming

1. What is C++? C++ (pronounced "see plus plus") is a programming language began as an expanded version of C. The C++ were first invented by Bjarne Stroustrup in 1979 at Bell Laboratories in Murray Hill, New Jersey. Bjarne Stroustrup initially called the new language "C with Classes." However, in ...

C/C++ Compiler (gcc) for Android - Run C/C++ programs on Android

C4droid is a user-friendly (but powerful) C/C++ IDE + C/C++ compiler for Android. Basic features of C4droid: Offline C compiler: create your own applications on Android device and run them even without Internet access Source code editor with syntax highlighting, tabs, code completion, code formatting, file association and undo/ ...

The do..... while loop in C++

The do.... while loop checks its condition at the bottom of the loop. A do.... while loop is similar to a while loop. The one difference is that the do.... while loop is guaranteed to execute at least one time. Syntax: do { statement(s); }while(condition); Example: int a=0; ...

The for loop in C++

A for loop is a repetition control structure that allows you to efficiently write a loop that executes a specific number of times. Syntax: for(init;condition;increment ) { statement(s); } The init step is executed first, and does not repeat. Next, the condition is evaluated, and the body of the ...

The while loop in C++

Loops: A loop repeatedly executes a set of statements until a particular condition is satisfied. A while loop statement repeatedly executes a target statement as long as a given condition remains true. Syntax: while(condition) { statement(s); } The loop iterates while the condition is true. The loop's body is the ...

Nested if & if/else Statements in C++

Nested if statements: You can also include, or nest, if statements within another if statement. For example: int mark = 100; if (mark >= 50) { cout << "You passed." << endl; if (mark == 100) { cout <<"Perfect!" << endl; } } else { cout << "You failed." << ...

Relational operator of C++

Additional relational operators: Operator Description Example == Equal to 4==2 False <= Less than or equal to 4<=2 False >= Greater than or equal to 4>=2 True != Not equal to 4!=2 True Example: if(10==10) { cout<<"Yes"; } Output: Yes The not equal ...

If else statement in C++

Else statement: An if statement can be followed by an optional else statement, which executes when the condition is false. Syntax: if(condition) { //statements } else { //statements } The compiler will test the condition: :-If it evaluates to true, then the code inside the if statement will be executed If it evaluates ...