answersLogoWhite

0

#include<stdio.h>

#include<conio.h>

void main()

{

int a,b,max,min,r;

printf("Enter the values of a,b");

scanf("%d%d",&a,&b);

if(a>b)

{

max=a;

min=b;

}

else

{

max=b;

min=a;

}

while((max%min)!=0)

{

r=max%min;

if(r==0)

{

break;

}

max=min;

min=r;

}

printf("GCD=%d",min);

getch();

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

What is the difference between an algorithm and java code?

In Java programming language, an algorithm refers to a sequence of instructions that have been specified to undertake a particular task within a certain time. An algorithm can take no or several inputs but will generate at least one output.


What is input in algorithm?

In an algorithm, input refers to the data or information that is provided to the algorithm for processing. It serves as the starting point for the algorithm's operations and can vary in type, such as numbers, text, or other data structures. The algorithm manipulates this input to produce an output, which is the result of its computations or actions. Properly defining and handling inputs is crucial for the algorithm's accuracy and effectiveness.


What is fundamental algorithm?

Algorithm It is the combination of sequential steps (these steps can be calculations, data processing, and reasoning tasks) use to resolve a problem in a very simple and efficient way. It is designed most efficiently that it can be expressed within a finite amount of space and time. we can implement it in any programming language. Properties of an algorithm : following are the main properties of an algorithm:- An algorithm must have a unique name. It should have explicitly defined sets of inputs and output. Algorithm must be in sequential order with unambiguous operations. It must have some endpoint, i.e., it halts in a finite amount of time. Visit for basic information about algorithms----&gt; geeksjournal.in/2020/01/20/introduction-to-design-and-analysis-of-algorithm/


What type of error in an algorithm will produce unexpected results depending on the number that the user inputs?

Algorithms do not accept user input; they are not computer programs. All input to an algorithm is specified at the start of the algorithm along with any required preconditions and postconditions. If a required precondition is not specified or is specified incorrectly, then this could result in unexpected results (or undefined behaviour in programming terminology). The type of error in the algorithm is simply that the precondition was not specified.


How would you write a program that read an integer for display each of digit of integer in English?

Use an enum if you are using a c style language. Or a map data structure. Assign each integer an English value and then match it to what the user inputs.

Related Questions

How do you make program specification?

you first of all state the function of the program. State the inputs that will be used,the algorithm and the outputs of the program.


What is the difference between an algorithm and java code?

In Java programming language, an algorithm refers to a sequence of instructions that have been specified to undertake a particular task within a certain time. An algorithm can take no or several inputs but will generate at least one output.


What is the proof of correctness for the algorithm being used in this system?

The proof of correctness for an algorithm demonstrates that it performs as intended and produces the correct output for all possible inputs. It ensures that the algorithm meets its specifications and functions accurately.


How can one demonstrate the correctness of an algorithm?

One can demonstrate the correctness of an algorithm by using mathematical proofs and testing it with various inputs to ensure it produces the expected output consistently.


What is the average time complexity of the algorithm being used for this task?

The average time complexity of the algorithm being used for this task is the measure of how the algorithm's running time grows as the input size increases. It helps to understand how efficient the algorithm is in handling larger inputs.


What is input in algorithm?

In an algorithm, input refers to the data or information that is provided to the algorithm for processing. It serves as the starting point for the algorithm's operations and can vary in type, such as numbers, text, or other data structures. The algorithm manipulates this input to produce an output, which is the result of its computations or actions. Properly defining and handling inputs is crucial for the algorithm's accuracy and effectiveness.


What are the two crucial factors that are used to evaluate the behavior of any implemented algorithm?

Time complexity and space complexity. More specifically, how well an algorithm will scale when given larger inputs.


What is fundamental algorithm?

Algorithm It is the combination of sequential steps (these steps can be calculations, data processing, and reasoning tasks) use to resolve a problem in a very simple and efficient way. It is designed most efficiently that it can be expressed within a finite amount of space and time. we can implement it in any programming language. Properties of an algorithm : following are the main properties of an algorithm:- An algorithm must have a unique name. It should have explicitly defined sets of inputs and output. Algorithm must be in sequential order with unambiguous operations. It must have some endpoint, i.e., it halts in a finite amount of time. Visit for basic information about algorithms----&gt; geeksjournal.in/2020/01/20/introduction-to-design-and-analysis-of-algorithm/


What is the input and output of kalman filter?

The Kalman filter is an algorithm to eliminate noise from statistical observations. The inputs and outputs are dependent on what you are applying it to.


What is the proof of correctness algorithm and how does it ensure the accuracy and reliability of a given algorithm?

The proof of correctness algorithm is a method used to demonstrate that a given algorithm performs as intended and produces the correct output for all possible inputs. It involves creating a formal proof that the algorithm meets its specifications and behaves correctly under all conditions. By rigorously analyzing the algorithm's logic and structure, the proof of correctness ensures that it is accurate and reliable in its operations.


What is cross products?

in mathematics the cross products are the binary operation on two vectors in a 3dimensional Euclidean space that results in another vector which is perpendicular to the containing the 2 inputs vector.


What is meaning of Test Benches in VHDL?

After compiling a hardware description language like VHDL, it is required to apply inputs to the program in order to obtain out puts. Applying the inputs involves initial conditions. As the systems designed using VHDL are electronic, the initial conditions plays a vital role. Hence, all these conditions along with the information as to where the input is expected to change from 1 to 0 or 0 to 1 is provided to the VHDL program. This is done in the form of a wave or another VHDL program. These are called VHDL test benches. In other words, test benches are the means of applying inputs to VHDL program.