Erster Commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "windows-gcc-x86",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**"
|
||||
],
|
||||
"compilerPath": "D:/Program Files/MinGW/bin/gcc.exe",
|
||||
"cStandard": "${default}",
|
||||
"cppStandard": "${default}",
|
||||
"intelliSenseMode": "windows-gcc-x86",
|
||||
"compilerArgs": [
|
||||
""
|
||||
]
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "C/C++ Runner: Debug Session",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"args": [],
|
||||
"stopAtEntry": false,
|
||||
"externalConsole": true,
|
||||
"cwd": "e:/01_EDU/UDEMY/Kurs - C Programming Bootcamp - The Complete C Language Course/A10/79-80. Print Reversed Number",
|
||||
"program": "e:/01_EDU/UDEMY/Kurs - C Programming Bootcamp - The Complete C Language Course/A10/79-80. Print Reversed Number/build/Release/outRelease",
|
||||
"MIMode": "gdb",
|
||||
"miDebuggerPath": "gdb",
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"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:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat",
|
||||
"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
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
//Made by Vlad. Budnitski.
|
||||
//AlphaTech - Programming Course.
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int num; // 531
|
||||
int reversedNum;
|
||||
int units, tens, hundreds;
|
||||
printf("Enter a 3-digit number: ");
|
||||
scanf("%d", &num);
|
||||
units = num % 10; // 1
|
||||
tens = (num / 10) % 10; // 3
|
||||
hundreds = num / 100; // 5
|
||||
|
||||
reversedNum = units; // 1
|
||||
reversedNum = reversedNum * 10 + tens; // 13
|
||||
reversedNum = reversedNum * 10 + hundreds; // 130 + 5 = 135
|
||||
|
||||
printf("Reversed Number of %d is: %d%d%d \n", num, units, tens, hundreds);
|
||||
printf("Reversed Number of %d = %d \n", num, reversedNum);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,35 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
// 531
|
||||
// 135
|
||||
// Units
|
||||
// Tens
|
||||
// Hundreds
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
int num;
|
||||
int units, tens, hundreds;
|
||||
int reversenum;
|
||||
|
||||
printf("Bitte geben sie eine dreistellige Zahl ein: \n");
|
||||
scanf("%d", &num);
|
||||
|
||||
units = num % 10;
|
||||
tens = (num / 10) % 10;
|
||||
hundreds = num / 100;
|
||||
|
||||
printf("units: %d\n", units);
|
||||
printf("tens: %d\n", tens);
|
||||
printf("hundreds %d\n", hundreds);
|
||||
|
||||
reversenum = units * 100;
|
||||
reversenum = reversenum + tens * 10;
|
||||
reversenum = reversenum + hundreds;
|
||||
|
||||
printf("The reverse number is: %d\n", reversenum);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user