Write a program for find greatest common divisor

Assignment Help C/C++ Programming
Reference no: EM131661

Problem 1

Greatest Common Divisor Write code for a recursive implementation of Euclid's algorithm for searching the greatest common divisor (GCD) of two integers. Descriptions of this algorithm are given in algebra books and on the Web. Prepare a test program that calls your GCD procedure five times, using the subsequent pairs of integers: (5,20), (24,18), (11,7), (432,226), (26,13). After each procedure call, shows the GCD.

Problem 2

Prepare a procedure named Str_concat that concatenates a source string to the end of a target string. Sufficient space must exist in the target string to accommodate the new characters. Pass pointers to the source and target strings. Here is a sample call:

.data
targetStr BYTE "ABCDE",10 DUP(0)
sourceStr BYTE "FGH",0
.code
INVOKE Str_concat, ADDR targetStr, ADDR sourceStr

Problem 3

Prepare a macro that writes a null-terminated string to the console with a given text color. The macro parameters should include the string name and the color. Hint: Call SetTextColor from the book's link library. Write a program that tests your macro with several strings in different colors. Sample call:
.data
myStringdb "Here is my string",0
.code
mWritestringmyString, white

Problem 4

Write a code that inputs the subsequent information from the user, using the Win32 ReadConsole function: first name, last name, age, phone number. Redisplay the same information with labels and attractive formatting, using the Win32 WriteConsole function. Do not use any procedures from the Irvine32 library.

Reference no: EM131661

Questions Cloud

Expected rate of return : What is your expected rate of return over the one-month holding period?
Determine expected payment : Determine expected payment
Solve the partial derivative : Solve the partial derivative
Analysis of a proposed soda tax : What does the market for sugary sodas look like?  Provide a supply-demand graph with realistic prices.
Write a program for find greatest common divisor : Write code for a recursive implementation of Euclid's algorithm
Laplace transforms : Calculation of a Laplace Transform from first principles
Benchmarking : What is the need for benchmarking?
Market research report : Market Research Report
Evaluate the fibonacci series : Write a program to evaluate the first 20 numbers of Fibonacci series.

Reviews

Write a Review

 

C/C++ Programming Questions & Answers

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

  Prepare an accounting for a dorm''s kitchen

The "purpose" of the program is to prepare an accounting (database) for e.g. a dorm's kitchen, to keep track of the consumption of beer for each room.

  C++ programming uml diagrams

The goal of this lab is to better familiarize you with polymorphism and the factory design pattern, two key components in Assignment

  Implementation of sorting technique

Implementation of sorting technique

  Write a program that converts between app and ppm values

Write a simple program that converts between APP and PPM values

  Calculate the trajectory of a soccer ball

Write a program to calculate the trajectory (flight path) of a soccer ball

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write two short c programs and solve exam-style problem

Write two short C programs and solve four exam-style problems.

  Structured programming using procedural languages

A a program that is called "Playing with Numbers or Letters".

  Prepare a linux shell

Prepare a linux shell (in other words, write a C/C++ program) that will recursively prompt for input from the user. The shell should prompt as

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Implement the guess the word

Implement  the ‘Guess the Word' game in an object-oriented manner

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd