am new to C++

please i wanna write a programme console application using borland turbo c++
that ask users for an angle entered in radians,the programme should then display the sine,cos and tan library functions to determaine these values.)the output should be displayed in fixed points notation,rounded up to four decimal notation.
please any help.
I'm not sure how new you are but first thing you might want to do is #include some header files, then declare main, variables... etc
i know what you mean,ican do those,but i just want a brief explanation in full about it.
a brief explanation in full

That's a bit of an oxymoron.
You'll need to show us whatever you have so far.
i am really new to C++,but i know i use boreland turbo C++
i know the followings writing code for console application
bases on my understanding,you start like these:
#include <iostream>
using namespace std;
int main()
{

}.
but really i know a few things.
For the sin(), cos(), and tan() functions you need to #include<cmath>, and for fixed points notation you need to #include<iomanip>.
please can you explain further?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//include your headers
#include <iostream>//lets you output to the console
#include <cmath>//provides basic math functions

//this function is where the program starts
int main(){
    double in;//double precision number (lets you use 3.14)
    cin>>in;//cin is defined in iostream
    //the >> operator is overloaded to input data from the console
    cout<<"Example";//cout outputs stuff to the console
    // anything surrounded with quotes is what's called a string
    return 0;}//return in main() ends the program
    //in any other function, it returns control to the function
    //that called it 

http://cplusplus.com/doc/tutorial/
Last edited on
Won't he need to #include<iomanip> as well?

#include <iostream>

int main()
{
int i;
std::cin>>i;
std::cout<<"i = "<<i<<std::endl;

return 0;
}

no need std:: if you use #include <iostream.h> head file .
or add using namespace std;
no need std:: if you use #include <iostream.h> head file .

That's because it's an old, deprecated header. Don't include it.
Topic archived. No new replies allowed.