Skip to content

Instantly share code, notes, and snippets.

@IanCarloz
Created September 6, 2017 16:12
Show Gist options
  • Save IanCarloz/5b2b15fe07461477226aa1a4ff8cfb0f to your computer and use it in GitHub Desktop.
Save IanCarloz/5b2b15fe07461477226aa1a4ff8cfb0f to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int nMotos, nTodoterrenos, nSedan, nDeportivos;
int lMotos, lTodoterrenos, lSedan, lDeportivos;
int tMotos, tTodoterrenos, tSedan, tDeportivos;
int total;
nMotos = 32;
nTodoterrenos = 11;
nSedan = 21;
nDeportivos = 4;
lMotos = 40;
lTodoterrenos = 65;
lSedan = 39;
lDeportivos = 45;
tMotos = nMotos * lMotos;
tTodoterrenos = nTodoterrenos * lTodoterrenos;
tSedan = nSedan * lSedan;
tDeportivos = nDeportivos * lDeportivos;
total = tMotos + tTodoterrenos + tSedan + tDeportivos;
second();
return total;
}
void second()
{
int a, b;
int suma, resta, multiplicacion;
float division;
printf("Please input an integer value for a: ");
scanf("%d", &a);
printf("Please input an integer value for b: ");
scanf("%d", &b);
suma = a + b;
if (suma > 100) {
printf("LA SUMA ES <100");
}
printf("Sum: %d\n", suma);
resta = a - b;
if (resta > 100) {
printf("LA RESTA ES >100");
}
printf("res: %d\n", resta);
multiplicacion = a * b;
if (multiplicacion > 100) {
printf("LA MULTIPLICACION ES >100");
}
printf("mult: %d\n", multiplicacion);
division = (float) a / b;
if (division > 100) {
printf("LA DIVISION ES >100");
}
printf("div: %f\n", division);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment