What do you want to save?
Add Code snippet
New code examples in category C++
-
ThisClark 2021-08-27 15:41:01
c++ sum up numbers
// Method 1: Mathematical -> Sum up numbers from 1 to n int sum(int n){ return (n * (n+1)) / 2; } // Method 2: Using a for-loop -> Sum up numbers from 1 to n int sum(int n){ int tempSum = 0; for (int i = n; i > 0; i--){ tempSum +=... Add solution -
Tarok 2021-08-27 13:47:02
is C++ useful in 2021
Yes Currently C++ is the 4th popular language Add solution -
ThesisWriter 2021-08-27 13:17:02
sum of number
// Find Sum of Digits of a Number using for Loop // ----codescracker.com---- #include<iostream> using namespace std; int main() { int num, rem, sum; cout<<"Enter the Number: "; cin>>num; for(sum=0; num>0; nu... Add solution -
Boreal hellenophile 2021-08-27 11:16:01
What is This pointer? Explain with an Example.
Every object in C++ has access to its own address through an important pointer called this pointer. The this pointer is an implicit parameter to all member functions. Therefore, inside a member function, this may be used to refer to the invoking object. ... Add solution -
Vladof81 2021-08-27 10:23:02
print hello world on c++
/*These are comments. They are used to assist the programmer. They do not affect the program in any way. Write whatever you want*/ #include <iostream> //preprocessor directive (use input/output) using namespace std; //use standard definitions //Th... Add solution