Skip to content
Snippets Groups Projects
Commit 297aa993 authored by Sandro Stephan Rufibach's avatar Sandro Stephan Rufibach
Browse files

Aufgabe 2 ausgefüllt

parent 24562d17
No related branches found
No related tags found
No related merge requests found
{
"configurations": [
{
"name": "windows-gcc-x64",
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "C:/msys64/ucrt64/bin/gcc.exe",
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "windows-gcc-x64",
"compilerArgs": [
""
]
}
],
"version": 4
}
\ No newline at end of file
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Runner: Debug Session",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"externalConsole": true,
"cwd": "c:/Users/srufi/Repositories/praktika-grulait/W3-01",
"program": "c:/Users/srufi/Repositories/praktika-grulait/W3-01/build/Release/outRelease",
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
\ No newline at end of file
{
"C_Cpp_Runner.cCompilerPath": "gcc",
"C_Cpp_Runner.cppCompilerPath": "g++",
"C_Cpp_Runner.debuggerPath": "gdb",
"C_Cpp_Runner.cStandard": "",
"C_Cpp_Runner.cppStandard": "",
"C_Cpp_Runner.msvcBatchPath": "",
"C_Cpp_Runner.useMsvc": false,
"C_Cpp_Runner.warnings": [
"-Wall",
"-Wextra",
"-Wpedantic",
"-Wshadow",
"-Wformat=2",
"-Wcast-align",
"-Wconversion",
"-Wsign-conversion",
"-Wnull-dereference"
],
"C_Cpp_Runner.msvcWarnings": [
"/W4",
"/permissive-",
"/w14242",
"/w14287",
"/w14296",
"/w14311",
"/w14826",
"/w44062",
"/w44242",
"/w14905",
"/w14906",
"/w14263",
"/w44265",
"/w14928"
],
"C_Cpp_Runner.enableWarnings": true,
"C_Cpp_Runner.warningsAsError": false,
"C_Cpp_Runner.compilerArgs": [],
"C_Cpp_Runner.linkerArgs": [],
"C_Cpp_Runner.includePaths": [],
"C_Cpp_Runner.includeSearch": [
"*",
"**/*"
],
"C_Cpp_Runner.excludeSearch": [
"**/build",
"**/build/**",
"**/.*",
"**/.*/**",
"**/.vscode",
"**/.vscode/**"
],
"C_Cpp_Runner.useAddressSanitizer": false,
"C_Cpp_Runner.useUndefinedSanitizer": false,
"C_Cpp_Runner.useLeakSanitizer": false,
"C_Cpp_Runner.showCompilationTime": false,
"C_Cpp_Runner.useLinkTimeOptimization": false,
"C_Cpp_Runner.msvcSecureNoWarnings": false
}
\ No newline at end of file
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: gcc.exe build active file",
"command": "C:\\msys64\\ucrt64\\bin\\gcc.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
\ No newline at end of file
File added
File added
File added
File added
#include <iostream>
using namespace std;
void aufgabe1() {
// Aufgabe 1
//char[] text = "Hallo Welt";// Geben sie "Hallo Welt!" auf der Konsole aus.
//int x = cin name;// Fragen sie mit "cin" nach dem Namen des Benutzers und speichern sie den Wert in einer Variable.
// Geben sie ein "Hallo *Wert der Variable*"" auf der Konsole aus.
}
void aufgabe2() {
// Aufgabe 2
int a = 5;
int b = 7;// Führen sie zwei Varaiblen ein, welche die Werte 5 und 7 haben.
int z = a + b;// Addieren sie die beiden Variablen und geben sie das Ergebnis auf der Konsole aus.
cout << "Resultat Aufgabe 2: " << z << endl;
// Verringern sie die erste Variable um 1 und erhöhen die Zweite um 1.
// Multiplizieren sie nun die beiden Variablen und geben sie das Ergebnis auf der Konsole aus.
}
void aufgabe3() {
// Aufgabe 3
// Führen sie eine Variable ein, welche den Wert 13 hat und eine mit dem Wert 5
// Dividieren sie den ersten durch den zweiten Wert und geben sie das Ergebnis auf der Konsole aus.
}
void aufgabe4() {
int a = 10;
int b;
cout << "Geben Sie eine Zahl ein:" << endl;
cin >> b;
// prüfen sie, ob a grässer oder gleichgrosse ist wie b und geben sie das Ergebnis auf der Konsole aus.
}
void aufgabe5() {
// Aufgabe 5
// Fragen sie vom User zwei Zahlen ab und geben sie aus, welche Zahl grösser ist.
}
// Dies ist under Hauptprogramm. Hier beginnt die Ausführung.
int main() {
aufgabe1();
aufgabe2();
aufgabe3();
//aufgabe4();
aufgabe5();
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment