Hi there,i am new in c++ and i am learning by my self, from google, wiki etc. you know and I want to make some programs.
first i want to make a program that calculates the degree of a number.
example code :
1 2 3 4 5 6 7 8 9 10 11
#include <iostream>
#include <cmath>
usingnamespace std;
int main ()
{int num;
double a;
cout <<"Please enter the numer";
cin>>num;
do (a=a+0.1)
while (a*a=num);
cout<<a;
For some reason it doesnt work.
This should calculate the degree of the num right?
and also how can i make a code so it calculates the root of a single num?
Something like :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <iostream>
#include <cmath>
usingnamespace std;
double f(double x)
{
num - x*2}
int main ()
{int num;
double a;
cout <<"Please enter the numer";
cin>>num;
cout<<x;