This file contains 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
#include <iostream> | |
using namespace std; | |
int main (){ | |
int n1,n2, suma=0; | |
cout << "\nI will ask to you two numbers and I will sum all the number that are in that range"<<endl; | |
cout << "\n Please give me the lower bound: "; | |
cin>>n1; | |
cout << "\n Please give me the higher bound: "; | |
cin>>n2; |
This file contains 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
#include <iostream> | |
#include <cstdlib> | |
#include <ctime> | |
using namespace std; | |
int main(){ | |
int numerores, numerointento, intento=0; | |
srand(time(NULL)); | |
numerores=rand()%100+1; |
This file contains 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
#include <iostream> | |
using namespace std; | |
int main(){//Jorge Samir Godinez Lara | |
int F,C; | |
cout <<"\nGive me the actual temperature in Farenheit and I'll convert to Celsius: "; //This is an output line, where I ask the user for Temperature | |
cin >>F; //This is the variable that I use to save Farenheit Temperature |
This file contains 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
#include <iostream> | |
using namespace std; | |
int thesum(int x, int y){ | |
int answer = x+y; | |
return answer; | |
} | |
int thediff (int x, int y){ | |
int answer = x-y; | |
return answer; | |
} |
This file contains 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
#include <iostream> | |
using namespace std; | |
int main(){ | |
int contador=0, multi, num; | |
cout<<"Dime un numero y te dire la tabla de multiplicar de ese numero: "; | |
cin>>num; | |
while(contador<=9) | |
{ | |
contador=contador+1; | |
multi=contador*num; |
This file contains 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
#include <iostream> | |
using namespace std; | |
int gcd(int a, int b) { | |
if(a == 0 ) return b; | |
if(b == 0 ) return a; | |
if(a > b) return gcd(b,a%b); | |
if(b>a) return gcd(a,b%a); | |
} |
This file contains 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
#include <iostream> | |
#include <math.h> | |
using namespace std; | |
int main (){ | |
float arrayf[10],sum=0,average, sq=0, desv; | |
for (int i=0; i<10; i++) | |
{ | |
cout<<"Give a number "<<(i+1)<<" : "<<endl; | |
cin>>arrayf[i]; |
This file contains 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
#include <iostream> | |
using namespace std; | |
float raizcuadrada(double x){ | |
float raiz = x, c = 0; | |
while (c != c){ | |
c = raiz; | |
raiz = (x/ + c)/2; | |
} | |
return raiz; |
This file contains 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
#include <iostream> | |
#include <cmath> | |
using namespace std; | |
float factorial(double a){ | |
float con, acum=1.0; | |
for(con=2.0; con<=a; con++){ | |
acum=acum*con; | |
} | |
return acum; |
This file contains 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
//Jorge Samir Godinez Lara/A01630155 | |
#include<iostream> | |
using namespace std; | |
void triangulo(int n){ | |
for(int i=1;i<=n;i++){ | |
for(int j=1;j<=i;j++) | |
{ | |
cout<<"T"; | |
} |
OlderNewer