Horje
c++ code Code Example
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;
}
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;

}




Cpp

Related
C++ Join thread Code Example C++ Join thread Code Example
get start with c++ Code Example get start with c++ Code Example
copy assignment operator in c++ Code Example copy assignment operator in c++ Code Example
functors in c++ Code Example functors in c++ Code Example
no template named vector in namespace std Code Example no template named vector in namespace std Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10