Author Topic: Terminal stopped working  (Read 2626 times)

Offline Robin46543

  • Single posting newcomer
  • *
  • Posts: 2
Terminal stopped working
« on: April 30, 2018, 01:55:21 pm »
Hellooo,
I am just starting to use Code::Blocks and everythin was working fine, until i tried this program.

Code
#include "stdio.h"
#include "stdlib.h"

// Definition der Variablen vom Typ integer

int variable_1;
int v2;
int e1;
int e2;
int e3;
int e4;



// Beginn des Hauptprogramms mit int main (), alles in den speziellen Klammern {} gehoert um Hauptprogramm. Genaue Erlaueterungen erst spaeter, muss aber hier schon
// verwendet werden, sonst laeuft nix....

int main ()

{

/* Pflichtuebung des ersten C-Kurses */
printf("Hallo Welt \n\n");


/* Einlesen der ersten Variablen */

printf("Bitte geben Sie die erste Zahl ein;\n");

scanf("%i", &variable_1);

printf("variable_1=%i\n\n", variable_1);


/* Einlesen der zweiten Variablen */


scanf("v2=%i\n\n", v2);
printf("variable_2=%i\n\n", v2);


// Rechnen mit diesen beiden Variablen

e1 = variable_1+v2;
e2 = variable_1-v2;
e3 = variable_1*v2;
e4 = variable_1/v2;

/* Ausgabe der Ergebnisse auf der Konsole; > Ausgabe in eine Datei kommt spaeter !!!*/

printf("Das Ergebnis ist %i", e1);
printf("Das Ergebnis ist %i", e2);
printf("Das Ergebnis ist %i", e3);
printf("Das Ergebnis ist %i", e4);

printf("Hallo Welt nochmals und tschuess!!! \n\n");

system ("Pause");

return (0);

}

I am German but i think u know what this code does. Anyway i can build and start it

https://prnt.sc/jbxchn

But if i try to enter a number (i.e. 2) it says

https://prnt.sc/jbxd0l

So I dont know. Maybe u can help me.

Offline Robin46543

  • Single posting newcomer
  • *
  • Posts: 2
Re: Terminal stopped working
« Reply #1 on: April 30, 2018, 02:02:15 pm »
oh wow

My Code was just wrong  ::) I solved it by myself