diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json deleted file mode 100644 index bf5a657..0000000 --- a/.vscode/c_cpp_properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "configurations": [ - { - "name": "windows-gcc-x64", - "includePath": [ - "${workspaceFolder}/**" - ], - "compilerPath": "C:/msys64/mingw64/bin/gcc.exe", - "cStandard": "${default}", - "cppStandard": "${default}", - "intelliSenseMode": "windows-gcc-x64", - "compilerArgs": [] - } - ], - "version": 4 -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 3a38e6b..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "name": "C/C++ Runner: Debug Session", - "type": "cppdbg", - "request": "launch", - "args": [ - "" - ], - "stopAtEntry": false, - "cwd": "e:/Training/20220222_Training/Multiple-of-Two-Numbers", - "environment": [], - "program": "e:/Training/20220222_Training/Multiple-of-Two-Numbers/build/Debug/outDebug", - "internalConsoleOptions": "openOnSessionStart", - "MIMode": "gdb", - "miDebuggerPath": "C:/msys64/mingw64/bin/gdb.exe", - "externalConsole": false, - "setupCommands": [ - { - "description": "Enable pretty-printing for gdb", - "text": "-enable-pretty-printing", - "ignoreFailures": true - } - ] - } - ] -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 388d8fc..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "C_Cpp_Runner.cCompilerPath": "C:/msys64/mingw64/bin/gcc.exe", - "C_Cpp_Runner.cppCompilerPath": "C:/msys64/mingw64/bin/g++.exe", - "C_Cpp_Runner.debuggerPath": "C:/msys64/mingw64/bin/gdb.exe", - "C_Cpp_Runner.cStandard": "", - "C_Cpp_Runner.cppStandard": "", - "C_Cpp_Runner.msvcBatchPath": "", - "C_Cpp_Runner.warnings": [ - "-Wall", - "-Wextra", - "-Wpedantic" - ], - "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/**" - ] -} \ No newline at end of file diff --git a/App/Multiple-of-Two-Numbers.exe b/App/Multiple-of-Two-Numbers.exe deleted file mode 100644 index 389ff4a..0000000 Binary files a/App/Multiple-of-Two-Numbers.exe and /dev/null differ diff --git a/Docs/Multiple-of-Two-Numbers-FL.docx b/Docs/Multiple-of-Two-Numbers-FL.docx deleted file mode 100644 index 4ceaa36..0000000 Binary files a/Docs/Multiple-of-Two-Numbers-FL.docx and /dev/null differ diff --git a/Docs/Multiple-of-Two-Numbers-OP.docx b/Docs/Multiple-of-Two-Numbers-OP.docx deleted file mode 100644 index 2b15a68..0000000 Binary files a/Docs/Multiple-of-Two-Numbers-OP.docx and /dev/null differ diff --git a/README.md b/README.md index 3a3ab45..5890903 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,23 @@ # Multiple-of-Two-Numbers -Folders and Files regarding exact multiple of 2 number. +- Objective: -It consist of the following files: -- App -- Docs -- src -- assests + To create a program which is used to find the multiple of two given numbers. -The following image shows the flow chart: -![Flow chart for multiple of two numbers](assets/Multiple-of-Two-Numbers.png) +The repository consists of following directories: + +- Assets: + + Assets are flowchart files. We created our flowchart for the task using Plantuml and stored it here. + +- Src: + + It contains our task's source. We can pull this source and work with it on any required time. + +The following is the flow chart: + +![Multiple of two numbers](assets/Multiple-of-Two-Numbers.png) + +- Version: + + multiple_of_two_numbers Version_v1.0.0 diff --git a/assets/Multiple-of-Two-Numbers.plantuml b/assets/Multiple-of-Two-Numbers.plantuml index 981707d..cba4919 100644 --- a/assets/Multiple-of-Two-Numbers.plantuml +++ b/assets/Multiple-of-Two-Numbers.plantuml @@ -1,15 +1,13 @@ @startuml start -:Get int num2, num1; -if(is_Multiple(num1, num2)?) then (Yes) -: Print num2 is a multiple of num1; +:Declare two variables for input; +:Get two integer input from user and store them in those variables; +if(is number2 multiple of number1?) then (Yes) +: Display number2 is a multiple of number1; else (No) -: Print num2 is not a multiple of num1; +: Display number2 is not a multiple of number1; endif stop -@enduml - - - +@enduml \ No newline at end of file diff --git a/assets/Multiple-of-Two-Numbers.png b/assets/Multiple-of-Two-Numbers.png index 11ecedb..a2c951a 100644 Binary files a/assets/Multiple-of-Two-Numbers.png and b/assets/Multiple-of-Two-Numbers.png differ diff --git a/src/Multiple-of-Two-Numbers.c b/src/Multiple-of-Two-Numbers.c index d48d517..6bb5734 100644 --- a/src/Multiple-of-Two-Numbers.c +++ b/src/Multiple-of-Two-Numbers.c @@ -1,21 +1,74 @@ +/* +Module: Multiple-of-Two-Numbers.c + +Function: + To find whether the given two numbers are multiple or not. + +Copyright notice: + This file copyright (C) 2022 by + + MCCI Corporation + 3520 Krums Corners Road + Ithaca, NY 14850 + + An unpublished work. All rights reserved. + + This file is proprietary information, and may not be disclosed or + copied without the prior permission of MCCI Corporation. + +Author: + Pranau R, MCCI Corporation March 2022 +*/ + #include -int is_Multiple(int num1, int num2) //using is_multiple function for two numbers -{ - return num2%num1 == 0; //if reminder of num2/num1 = 0, then num2 is a multiple -} + +/****************************************************************************\ +| +| Function +| +\****************************************************************************/ + +int is_Multiple(int num1, int num2) //using is_multiple function for two numbers + { + return num2 % num1 == 0; //if reminder of num2/num1 = 0, then num2 is a multiple + } + +/****************************************************************************\ +| +| Code. +| +\****************************************************************************/ + int main() -{ - int num1, num2; //declaring integer num1 and num2 + { + printf("\n"); + printf("--------------------------------------------------------------------------------\n"); + printf("This is multiple of two numbers v1.0.0\n"); + printf("--------------------------------------------------------------------------------\n"); + printf("\n"); + printf("It is used to find the multiple of any given two whole numbers.\n\n"); + + int num1, num2; // declaring integer num1 and num2 - printf("Enter the first Number:"); //getting our first number from user using printf and scanf funtion + printf("\nEnter the first Number: "); // getting our first number from user using printf and scanf funtion scanf("%d", &num1); - printf("Enter the second Number:"); //getting our second number from user using printf and scanf funtion + + printf("Enter the second Number: "); // getting our second number from user using printf and scanf funtion scanf("%d", &num2); - if (is_Multiple(num1, num2)) //using the condition in main and printing the command if it is true - printf("%d is a multiple of %d\n", num2, num1); - else //using the condition in main and printing the command if it is false - printf("%d is not a multiple of %d\n", num2, num1); + printf("\n\n-------------------------------------------------\n"); + + if (is_Multiple(num1, num2)) // using the condition in main and printing the command if it is true + { + printf("\n\n%d is a multiple of %d\n", num2, num1); + } + else // using the condition in main and printing the command if it is false + { + printf("%d is not a multiple of %d\n", num2, num1); + } + + printf("\n\nPress any key to close the program!...\n"); + getch(); return 0; -} \ No newline at end of file + } \ No newline at end of file