Write the C code below in Assembly Language include include

Write the C++ code below in Assembly Language.

#include <iostream>
#include <string>
int fact(int n){
if(n==1 || n==0){
return 1;
}else{
return n*fact(n-1);
}
return n;
}
int main()
{
std::cout<<\"Factorials 1-9\ \";
for(int i =0; i<=9;i++){
std::cout<<i<<\" \"<<fact(i)<<\"\ \";
}
}

Solution

you can compile it as :   g++ -S myfile.cpp

This will generate myfile.S with code of c++ converted to assembly code.

Write the C++ code below in Assembly Language. #include <iostream> #include <string> int fact(int n){ if(n==1 || n==0){ return 1; }else{ return n*fa

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site