I need this in Assembly code This started piece was provided so the code just ha
ID: 3824555 • Letter: I
Question
I need this in Assembly code
This started piece was provided so the code just have to be finished :
6. Greatest Common Divisor (GCDO The greatest common divisor (GCD) of two integers is the largest integer that will evenly divide both integers. The GCD algorithm involves integer division in a loop, described by the following pseudocode: int GCD (int x, int y) x abs (x) absolute value y E abs (y) do 1 int n x y while (y 0) return x Implement this function in assembly language and write a test program that calls the function several times, passing it different values. Display all results on the screen.Explanation / Answer
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <process.h>
void main()
{
char a[1000],u;
int i,j,k,x,y;
clrscr();
i = j = k = 0;
while(1)
{
printf(" Enter any string : ");
gets(a);
strlwr(a);
while(a[i] != '')
{
if(a[i] == ' ')
j++;
if ( (a[i] == 'a') || (a[i] == 'e') || (a[i] == 'i') || (a[i] == 'o') || (a[i] == 'u') )
k++;
i++;
}
printf(" Total Vowels in a string are : %d",k);
printf(" Total Blank Spaces in a string are : %d",j);
printf(" Total Characters in a string are : %d",i);
printf(" Want to input more (y/n) : ");
u = getch();
if(u == 'n')
{
printf(" Press any key to continue.....");
getch();
exit(1);
}
}
getch();
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.