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

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Calculation of mortgage interest rates

Instruction of pointers and the calculation of mortgage interest rates.

  Create program that uses functions and reference parameters

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

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Write a program to read a data file and extract parameters

Write a C/C++ program to read a data file and extract parameters. The program must obtain the filename via a command-line argument.

  Computer programming using c language lab

Computer programming using c language lab

  Implementation of sorting technique

Implementation of sorting technique

  Write a program using vectors and iterators

Create a program that uses at least two functions that will be called from your main. This program is a number game program that asks for parts of your phone and after manipulating it mathematically, eventually outputs your entire phone number. The d..

  Develop a basic temperature class

You have to develop a basic temperature class

  Loops and if conditions

Write a program that requests a password

  Public transport fare ticketing system

Implement and test a public transport fare ticketing system.

  Convert celsius temperatures to fahrenheit temperatures

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

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