English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Also, how do you control the number of decimal places of float in C++? In C, you can control the number of decimal places you print. Thanks.

2007-07-20 15:58:30 · 4 answers · asked by Kisses 4 in Computers & Internet Programming & Design

4 answers

Assuming u're using Borland C++, u can use clrscr() function also if u do #include at the initial stage of program. Or, if u do only #include then u've to write
system("cls");
[The MS Visual C++ supports only the 2nd one, i.e. system("cls");]

2007-07-21 03:09:37 · answer #1 · answered by Innocence Redefined 5 · 0 0

First, clrscr() isn't part of the C or C++ standard library. That's right, conio.h is something shipped with your compiler, it's not part of C. So there is no equivalent from C to C++ because it doesn't exist in the first place. If you want to use clrscr, just include conio.h in C++ as well. For getch(), the same is true. It is part of conio.h, which is not part of C or C++. If you want to use, include conio.h, but it won't compile everywhere (not everyone will have conio.h because it is not part of C++). Panky, there's a couple of issues I have with your code. First, C++ went through an update nearly a decade ago. One of them is that standard library include names don't have a .h. I recommend you revise your C++ knowledge. It should be #include . You need a using namespace std directive if you want to avoid the namespace qualifier on cout and endl. Finally, it is not void main. It is int main. Your code won't compile on an ISO compliant compiler. Or at least, it will raise a warning.

2016-04-01 04:37:33 · answer #2 · answered by ? 4 · 0 0

system("cls")
the number of decimal places of float in C++ can be controlled by using C++ functions

2007-07-20 16:53:30 · answer #3 · answered by iyiogrenci 6 · 0 1

what is the proto type of system("cls");

2014-01-09 17:26:12 · answer #4 · answered by zafar_bhutto 1 · 0 0

fedest.com, questions and answers