How to conver a simple function Mex, and call it to another file.
#include <iostream>
using namespace std;
int main()
{
int firstNumber, secondNumber, sumOfTwoNumbers;
cout << "Enter two integers: ";
cin >> firstNumber >> secondNumber;
// sum of two numbers in stored in variable sumOfTwoNumbers
sumOfTwoNumbers = firstNumber + secondNumber;
// Prints sum
cout << firstNumber << " + " << secondNumber << " = " << sumOfTwoNumbers;
return 0;
}

Respuestas (1)

James Tursa
James Tursa el 6 de Nov. de 2020

0 votos

See the input( ) function for getting the inputs from the user. Then see the fprintf( ) function for displaying formatted output to the user.

Categorías

Etiquetas

Preguntada:

el 5 de Nov. de 2020

Respondida:

el 6 de Nov. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by