Wo ist der Fehler in meinem C++-Code?

Hi,

ich habe mit dem Programmieren angefangen. Mein Code geht nicht. Wo ist der Fehler?

#include <iostream>

int main() {
  int x = 5
  int y = 10
  int z = x + y
  std::cout << "Das Ergebnis von x und y ist: " << z << std:endl

  int a = 7
  int b = 3
  int c = a * b
  std::cout << "Das Ergebnis von a und b ist: " << c << std:endl
  
  int d = 42
  int e = 0
  int f = d / e
  std:cout << "Das Ergebnis der Division von d durch e ist: " << f << std:endl

  char* str = "Hi Welt!"
  std:cout << str << std:endl

  return 0
}
(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
11 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
NorbertWillhelm
11 months ago

You can’t share with 0.

Can check if split by 0 before.

It must also std::endl.

Rlohdaen
11 months ago

It is extremely stupid to use a development environment for entry without usable error messages. To be honest – I’m not aware of any error messages. I see some mistakes here – but you have to learn to find and interpret the error messages yourself / get smart. Otherwise, you are simply wrong with this subject.

Kisam88
11 months ago

std::endl

the

std:endl

Quetschtuete
11 months ago

You don’t like semicolons, do you?

Kisam88
11 months ago
Reply to  DaHocklbergl06

You must set a semicolon (;) at the end of each instruction.

Quetschtuete
11 months ago
Reply to  DaHocklbergl06

only

Quetschtuete
11 months ago
Reply to  DaHocklbergl06

Okay.

cleanercode
11 months ago
Reply to  Quetschtuete

😀

Quetschtuete
11 months ago

He knows he loves