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

  Calculate the trajectory of a soccer ball

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

  Iterative programming problem solving approaches

Write a recursive function void reverse ( ) that reverse a sentence

  Develop a basic temperature class

You have to develop a basic temperature class

  Write a webservices application

Write a webservices application that does a simple four function calculator

  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

  Computer programming techniques

Construct a program from a design and use appropriate functions

  Calculation of mortgage interest rates

Instruction of pointers and the calculation of mortgage interest rates.

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Describe the probability of the moves

Write a program in C++ to describe the Probability of the moves

  Create a template class

Create a template class, SVector, that implements a constructor

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

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