tu raj. O-bli-gé
Oui, je dois quitter et je mange des petit pois-carottes-pommes de terre
.tu raj. O-bli-gé
.Niark. moi c'est pizza ce soir !
? Bon allez je quitte, je pourrais aller un peu après, a tout de suite
.tu programme en C et tu connait pas les fraction?
Désolé arno, mais nous on est pas né pros de la programmation.Euh... Y'a erreur là, ce qu'il fait je n'appelle pas ça programmer.
Non, mais y'a deux voies quand tu commences, la voie du débutant, et la voie du kikootroll. Xana a fait son choix.Désolé arno, mais nous on est pas né pros de la programmation.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int num1 = 0, num2 = 0, num3 = 0;
int numchosen = 0, numchosen1 = 0;
printf("SHITTY CALCULATOR V1\n\n\n");
printf("\nFor addition type 1 then Enter\nFor subtraction type 2 then Enter\nFor multiplication type 3 then Enter\nFor division type 4 then Enter\n");
scanf ("%d", &numchosen);
switch (numchosen)
{
case 1:
printf("You have chosen addition\nType the first number then hit Enter\n");
scanf ("%d", &num1);
printf("Your first number is %d\n Type the second number then hit Enter\n", num1);
scanf("%d", &num2);
num3 = num1 + num2;
printf("%d + %d = %d\n", num1, num2, num3);
break;
case 2:
printf("You have chosen substraction\nType the first number then hit Enter\n");
scanf ("%d", &num1);
printf("Your first number is %d\n Type the second number then hit Enter\n", num1);
scanf("%d", &num2);
num3 = num1 - num2;
printf("%d - %d = %d\n", num1, num2, num3);
break;
case 3:
printf("You have chosen multiplication\nType the first number then hit Enter\n");
scanf ("%d", &num1);
printf("Your first number is %d\n Type the second number then hit Enter\n", num1);
scanf("%d", &num2);
num3 = num1 * num2;
printf("%d x %d = %d\n", num1, num2, num3);
break;
case 4:
printf("You have chosen division\nType the first number then hit Enter\n");
scanf ("%d", &num1);
printf("Your first number is %d\n Type the second number then hit Enter\n", num1);
scanf("%d", &num2);
num3 = num1 / num2;
printf("%d / %d = %d\n", num1, num2, num3);
break;
default:
printf("Dumbfuck, can't even enter a number between 1 and 4");
break;
}
printf("If you want to use the calculator one more time, type 1 then press Enter\nIf you want quit, type 2 then hit Enter");
scanf("%d", &numchosen1);
if (numchosen1 == 1)
{
printf("\nFor addition type 1 then Enter\nFor subtraction type 2 then Enter\nFor multiplication type 3 then Enter\nFor division type 4 then Enter\n");
scanf ("%d", &numchosen);
switch (numchosen)
{
case 1:
printf("You have chosen addition\nType the first number then hit Enter\n");
scanf ("%d", &num1);
printf("Your first number is %d\n Type the second number then hit Enter\n", num1);
scanf("%d", &num2);
num3 = num1 + num2;
printf("%d + %d = %d\n", num1, num2, num3);
break;
case 2:
printf("You have chosen substraction\nType the first number then hit Enter\n");
scanf ("%d", &num1);
printf("Your first number is %d\n Type the second number then hit Enter\n", num1);
scanf("%d", &num2);
num3 = num1 - num2;
printf("%d - %d = %d\n", num1, num2, num3);
break;
case 3:
printf("You have chosen multiplication\nType the first number then hit Enter\n");
scanf ("%d", &num1);
printf("Your first number is %d\n Type the second number then hit Enter\n", num1);
scanf("%d", &num2);
num3 = num1 * num2;
printf("%d x %d = %d\n", num1, num2, num3);
break;
case 4:
printf("You have chosen division\nType the first number then hit Enter\n");
scanf ("%d", &num1);
printf("Your first number is %d\n Type the second number then hit Enter\n", num1);
scanf("%d", &num2);
num3 = num1 / num2;
printf("%d / %d = %d\n", num1, num2, num3);
break;
default:
printf("Dumbfuck, can't even enter a number between 1 and 4");
break;
}
}
if (numchosen1 == 2)
{
return 0;
}
else
{
printf("Dumb Dumbfucks Are Dumb!");
}
}
#include <stdio.h>
#include <stdlib.h>
// Ne pas oublier les anti-slash et non les slash !!
int main(int argc, char *argv[])
{
int resultat = 0, nombre1 = 0, nombre2 = 0, choixOperation = 0, choixEnd = 0;
do
{
printf("Ecrivez le nombre 1 :\n\n");
scanf("%d", &nombre1);
printf("Ecrivez le nombre 2 :\n\n");
scanf("%d", &nombre2);
printf("Choississez votre operation :\n\n");
printf("1. Addition .\n");
printf("2. Soustraction .\n");
printf("3. Multiplication .\n");
printf("4. Division .\n");
printf("5. Modulo .\n");
scanf("%d", &choixOperation);
switch(choixOperation)
{
case 1:
resultat = nombre1 + nombre2;
printf("%d + %d = %d\n\n", nombre1, nombre2, resultat);
break;
case 2:
resultat = nombre1 - nombre2;
printf("%d - %d = %d\n\n", nombre1, nombre2, resultat);
break;
case 3:
resultat = nombre1 * nombre2;
printf("%d * %d = %d\n\n", nombre1, nombre2, resultat);
break;
case 4:
resultat = nombre1 / nombre2;
printf("%d / %d = %d\n\n", nombre1, nombre2, resultat);
break;
case 5:
resultat = nombre1 % nombre2;
printf("%d % %d = %d\n\n", nombre1, nombre2, resultat);
break;
default:
printf("Choix Impossible");
break;
}
printf("Voulez vous faire un nouveau calcul ?\n");
printf("1. Faire un nouveau calcul\n");
printf("2. Eteindre la calculatrice\n");
scanf("%d", &choixEnd);
} while(choixEnd != 2);
return 0;
}
.printf("1. Faire un nouveau calcul\n");
printf("2. Eteindre la calculatrice\n");
scanf("%d", &choixEnd);
} while(choixEnd != 2);
return 0;
}
mais on peux calculer que 1 et 2...c'est juste une fucking fenêtre de dialogue en fait!Code:#include <stdio.h> #include <stdlib.h> // Ne pas oublier les anti-slash et non les slash !! int main(int argc, char *argv[]) { int resultat = 0, nombre1 = 0, nombre2 = 0, choixOperation = 0, choixEnd = 0; do { printf("Ecrivez le nombre 1 :\n\n"); scanf("%d", &nombre1); printf("Ecrivez le nombre 2 :\n\n"); scanf("%d", &nombre2); printf("Choississez votre operation :\n\n"); printf("1. Addition .\n"); printf("2. Soustraction .\n"); printf("3. Multiplication .\n"); printf("4. Division .\n"); printf("5. Modulo .\n"); scanf("%d", &choixOperation); switch(choixOperation) { case 1: resultat = nombre1 + nombre2; printf("%d + %d = %d\n\n", nombre1, nombre2, resultat); break; case 2: resultat = nombre1 - nombre2; printf("%d - %d = %d\n\n", nombre1, nombre2, resultat); break; case 3: resultat = nombre1 * nombre2; printf("%d * %d = %d\n\n", nombre1, nombre2, resultat); break; case 4: resultat = nombre1 / nombre2; printf("%d / %d = %d\n\n", nombre1, nombre2, resultat); break; case 5: resultat = nombre1 % nombre2; printf("%d % %d = %d\n\n", nombre1, nombre2, resultat); break; default: printf("Choix Impossible"); break; } printf("Voulez vous faire un nouveau calcul ?\n"); printf("1. Faire un nouveau calcul\n"); printf("2. Eteindre la calculatrice\n"); scanf("%d", &choixEnd); } while(choixEnd != 2); return 0; }
Voila le code de ma calculette Choco.