how to code in c++
help me i dont now what the freak am doing any more
how to code in c++
help me i dont now what the freak am doing any more
basic cpp programs
// Your First C++ Program
#include <iostream>
int main() {
std::cout << "Hello World!";
return 0;
}
c++ basic code
#include <iostream>
#include<conio.h> /* For getch() only */
using namespace std;
int main () {
int num = 10;
if (num % 2 == 0)
{
cout<<"It is an even number";
}
getch(); /* getch is the function of conio.h */
}
c++ code
#include <bits/stdc++.h>
using namespace std;
long int getSumOfFactors(int n)
{
long int temp = 0;
for (int i=1;i<=n;i++){
if (n%i==0) temp = temp+i;
}
return temp;
}
int main()
{
int n;
cout<<"Input the number : ";
cin>>n;
long int result = getSumOfFactors(n);
cout<<"\nThe Summation of the all the factors of the number is : "<<result;
}
c++ code
#include<bits/stdc++.h>
using namespace std;
int
main ()
{
string s1, s2;
cin >> s1 >> s2;
cout << s1.size () << " " << s2.size () << endl;
cout << s1 << s2 << endl;
char temp;
temp = s1[0];
s1[0] = s2[0];
s2[0] = temp;
cout << s1 << " " << s2 << endl;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us