0% found this document useful (0 votes)
4 views2 pages

Bai Tinhs Tong

The document contains multiple C++ programs that perform various calculations. These include summing integers, calculating square roots, summing series, and working with ASCII values of characters. Each program takes user input and outputs the result of the computation.

Uploaded by

2356210033
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Bai Tinhs Tong

The document contains multiple C++ programs that perform various calculations. These include summing integers, calculating square roots, summing series, and working with ASCII values of characters. Each program takes user input and outputs the result of the computation.

Uploaded by

2356210033
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include <iostream>

using namespace std;


int main()
{
int N,S=0;

cout<<"Nhap gia tri N:";


cin>> N;
for(int i=1;i<=N; i++)
{S+=i;
}
cout<<"Tong S="<<S<<endl;
return 0;
}

#include<cmath>
#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
float S=1;
for (int i=1; i<=n; i++)
S=sqrt(S*i);
cout<<S;
return 0;
}

#include <iostream>
using namespace std;
int main()
{
int n;
float S=0;
cin>>n;
for (int i=1; i<=n; i++)
S+=1.0/(2*i);
cout<<S;
return 0;
}

#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
float GT=1; float T=0;
for (int i=1; i<=n; i++)
{
GT=GT*i;
T+=1/GT;
}
cout<<T;
return 0;
}

#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
float GT=1; float T=0; hoacj ,
for (int i=1; i<=n; i++)
{
GT=GT*i;
T+=1/GT;
}
cout<<T;
return 0;
}

#include <iostream>
using namespace std;

int main() {
char c1, c2;
int x;
cin >> c1;
cin >> c2;
cin >> x;
cout << "Ma ASCII cua ky tu '" << c1 << "','" << c2<< "' lan luot la " <<
int(c1) << " va " << int(c2) << endl;
cout << "Khoang cach giua hai ky tu '" << c1 << "', '" << c2 << "' la " <<
abs(int(c1) - int(c2)) << endl;
cout << "Dang viet hoa cua ky tu '" << c1 << "' la '" << char(c1 - 32) << "'"
<< endl;
cout << x << " la ma ASCII cua ky tu '" << char(x) << "'" << endl;
return 0;
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy