This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // T(n)=1*2*3*....n | |
| #include <stdio.h> | |
| #include <conio.h> | |
| int main() | |
| { | |
| int n; | |
| long long t=1; | |
| printf("n=");scanf("%d",&n); | |
| for(int i=1;i<=n;i++) | |
| t=t*i; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //S(n) = 1 + 1/2 + 1/3 + 1/4 + ... + 1/n (n > 0) | |
| #include <stdio.h> | |
| #include <conio.h> | |
| int main() | |
| { | |
| int n; | |
| float s=0; | |
| do | |
| { | |
| printf("n=");scanf("%d",&n); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //S(n) = 1 / 1 * 2 + 1 / 2 * 3 + ... + 1 / n * (n + 1) (voi n > 0) | |
| #include <stdio.h> | |
| #include <conio.h> | |
| int main() | |
| { | |
| int n; | |
| float s=0; | |
| printf("n=");scanf("%d",&n); | |
| for(int i=1;i<=n;i++) | |
| s=s+1/(float(i+1)*i); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // T(x, n) = x ^ n | |
| #include <stdio.h> | |
| #include <conio.h> | |
| #include <math.h> | |
| int main() | |
| { | |
| int x,n; | |
| float t; | |
| printf("x=");scanf("%d",&x); | |
| printf("n=");scanf("%d",&n); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // S(x, n) = x + x^2 + x^3 + ... + x^n | |
| #include <stdio.h> | |
| #include <conio.h> | |
| #include <math.h> | |
| int main() | |
| { | |
| int x,n; | |
| long long s=0; | |
| printf("x=");scanf("%d",&x); | |
| printf("n=");scanf("%d",&n); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // S(x, n) = 1 + x^2/2! + x^4/4! + ... + x^2n/(2n)! | |
| #include <stdio.h> | |
| #include <conio.h> | |
| #include <math.h> | |
| int gt(int k) | |
| { | |
| long s=1; | |
| for(int i=1;i<=k;i++) | |
| s*=i; | |
| return s; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //S(x, n) = 1 + x + x^3/3! + x^5/5! + ... + x^(2n + 1)/(2n + 1)! | |
| #include <stdio.h> | |
| #include <conio.h> | |
| #include <math.h> | |
| int gt(int k) | |
| { | |
| long s=1; | |
| for(int i=1;i<=k;i++) | |
| s*=i; | |
| return s; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // dem so nguyen duong | |
| #include <stdio.h> | |
| #include <conio.h> | |
| int main() | |
| { | |
| int n; | |
| printf("Nhap so luong phan tu: ");scanf("%d",&n); | |
| int a[n]; | |
| for(int i=0;i<n;i++) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 54846846=>8 | |
| #include<stdio.h> | |
| int main() | |
| { | |
| int n, t, max, min; | |
| max = 1; min = 9; | |
| printf("Nhap so n: "); | |
| scanf("%d", &n); | |
| while (n = n / 10) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //liet ke so le cua n | |
| #include <stdio.h> | |
| #include <conio.h> | |
| int main() | |
| { | |
| int n,t; | |
| do{ | |
| printf("n=");scanf("%d",&n); | |
| } | |
| while(n<=0); |