I've been working on this program and I have it all pretty much down, but I just need one thing that I can't, for the life of me, think of! I need to find the reciprocal of a number that the user inputted (ex: if user input was 2 output would be 0.5 or if input was .6, out put would be 1.6 repeating). If theres a simple way, I can't think of it. Thanks.
#include <iostream>
main()
{
double usernum,reciprocal;
std::cout<<"What number do you want to get the reciprocal of? ";
std::cin>>usernum;
reciprocal=1/usernum;
std::cout<<"The reciprocal of "<<usernum<<" is "<<reciprocal<<".";
}