Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .vscode/c_cpp_properties.json

This file was deleted.

28 changes: 0 additions & 28 deletions .vscode/launch.json

This file was deleted.

30 changes: 0 additions & 30 deletions .vscode/settings.json

This file was deleted.

Binary file removed App/Multiple-of-Two-Numbers.exe
Binary file not shown.
Binary file removed Docs/Multiple-of-Two-Numbers-FL.docx
Binary file not shown.
Binary file removed Docs/Multiple-of-Two-Numbers-OP.docx
Binary file not shown.
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
14 changes: 6 additions & 8 deletions assets/Multiple-of-Two-Numbers.plantuml
Original file line number Diff line number Diff line change
@@ -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
Binary file modified assets/Multiple-of-Two-Numbers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 66 additions & 13 deletions src/Multiple-of-Two-Numbers.c
Original file line number Diff line number Diff line change
@@ -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<stdio.h>
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;
}
}