Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

#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;
@samir96
samir96 / Guess
Created February 14, 2015 06:48
Pick a number
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main(){
int numerores, numerointento, intento=0;
srand(time(NULL));
numerores=rand()%100+1;
#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
#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;
}
@samir96
samir96 / gist:e018781d0797f860f617
Created February 21, 2015 05:32
Ejemplo como github
#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;
#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);
}
#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];
#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;
#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;
//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";
}