Hello there! Expora here again. I'm trying to get the hang of functions now and I made a simple program to calculate percent but I don't seem able to get it to work I can enter the 2 numbers but when i get the results is something like 0041123f. Any ideas? Here's the code:
#include <iostream>
//Percent Calculator
int percent (int x, int y) {
return (x/y)*100;
}
int main()
{
int x;
int y;
std::cout<<"Entrar dividendo: ";
std::cin>> x;
std::cin.ignore();
std::cout<<"Entrar divisor: ";
std::cin>> y;
std::cin.ignore();
std::cout<<"Su porciento es: "<< percent ;
std::cin.get();
}
Im thinking something where I defined the funtion? Well any input is apreciated.
Thanks,
Expora