Question about Computers & Internet

1 Answer

Problem with double precision in c

Hi all i am running turbo c in vista through dosbox.
i have written the following code-
#include
int main()
{
double a=1,b=41395200,f;
f=a/b;
printf('' f= %lf'',f)
}
it produces me the output 0.000000
while i am expecting 0.000000024
i need value upto 12 places after decimal.
why it is not producing with double precision.
plzzz help; its urgent.

Posted by on

Ad

1 Answer

  • Level 2:

    An expert who has achieved level 2 by getting 100 points

    MVP:

    An expert that got 5 achievements.

    Sniper:

    An expert who has posted more than 50 answers, of which 90% or more were rated as helpful.

    Governor:

    An expert whose answer got voted for 20 times.

  • Expert
  • 61 Answers

It's a long time since I played with Turbo C but there are a couple of things you could try since problem is clearly in printf formatting.

First try using capital L as " f= %Lf". Lower case 'l' normally precedes an integer variable type and may be forcing conversion to 7 digits.

No luck? Try " f= %.12f". This should force 12 decimal places.

Sorry I don't have Turbo C around anymore so can't try it myself.

Posted on Jul 24, 2009

Ad

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
Best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of.(from cars to computers, handyman, and even drones)
click here to download the app (for users in the US for now) and get all the help you need.
Goodluck!

Posted on Jan 02, 2017

Ad

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

6 Answers

How to run turbo c++in vista 64 bit os


You can run Turbo C++ 3.0 on Windows XP 64 bit , Vista 32 bit and 64 bit OS (in full screen)

Install the software DOSBox ver 0.72 (Freeware) from the link below (Direct Link)

http://prdownloads.so urcef orge.net/dosbox/DOSBox0.72-win 32-in staller.exe?download

Before going to the details u have to create a folder (any name will do).

Here we name it as Turbo

Copy the TC into the Turbo folder

Run the DOSBox 0.72 from the icon located on the desktop or from the location of the installation folder

Then u are presented with two screens which look like the command prompt in Windows

Now u are presented with two screens. One with a Z prompt. U can ignore the other screen.

There type the following commands at the command prompt [Z]:

Mount [Type in any alphabet that u wish except z] [Type the source of the turbo C] press enter

For example (Type in the following commands after the Z prompt):

Z: mount d c:\Turbo\ [The folder TC is present inside the folder Turbo]

* Now u should get a message which says: Drive D is mounted as a local directory c:\Turbo\ ***

C:\> cd TC [The contents inside the folder Turbo gets mounted as a virtual drive (Here D drive)

source site :

http://mycomputer.freefor ums.o rg/running-turbo-c-in-full-scr een-m ode-help-t1241.html .

Sep 03, 2009 | Microsoft Windows Vista Ultimate Edition

3 Answers

Plz tell me how i can run c++ in full screen in vista ultimate


Hello

Use the command prompt. Maximize the window size. Change directory to c:. You will have a line that fits 75 characters and a window that occupies about 2/3 of the whole window. That's enough fore all reasonable problems. If you are not happy with what you get, you may try developping your C++ program under Linux.

Hope it helps

Aug 29, 2009 | Compaq Presario 700 470024-192 Notebook

1 Answer

Problem for installing turboc++4.5 in wista


ok man i too had teh same prob dont back to xp

Before going to the details u have to create a folder (any name will do). Here we name it as Turbo

Copy the TC into the Turbo folder

Run the DOSBox 0.72 from the icon located on the desktop or from the location of the installation folder

Then u are presented with two screens which look like the command prompt in Windows

Now u are presented with two screens. One with a Z prompt. U can ignore the other screen.

There type the following commands at the command prompt [Z]:

Mount [Type in any alphabet that u wish except z] [Type the source of the turbo C] press enter

Now , Type in the following commands after the Z prompt:

Z: mount d c:\Turbo\ [The folder TC is present inside the folder Turbo]

* Now u should get a message which says: Drive D is mounted as a local directory c:\Turbo\ ***

Now type d: to shift to d: prompt .

D: cd TC [The contents inside the folder Turbo gets mounted as a virtual drive (Here D drive)

D: cd Bin

D: TC or Tc.exe [This presents u the Turbo C++3.0 screen]

On the Turbo C++ goto Options>Directories>Change the source of TC to the source directory [D] ( i.e. virtual D: refers to original c:\Turbo\ . So make the path change to something like D:\TC\include and D:\TC\lib respectively )

===========================================================

In order to get the full screen use the key combination of Alt and Enter

When u exit from the DosBox [precisely when u unmount the virtual drive where Turbo C++ 3.0 has been mounted] all the files u have saved or made changes in Turbo C++ 3.0 will be copied into the source directory(The directory which contains TC folder)

It is a good idea to backup your files in the source directory prior to running DOSBox 0.72

For additional help go through the readme file located in the installation folder or look on the website of the DOSBox forum.

The above procedure has been successfully implemented on Windows Vista Ultimate 64 bit

IMP : Don't use shortcut keys to perform operations in TC because they might be a shortuct key for DOSBOX also . Eg : Ctrl+F9 will exit DOSBOX rather running the code .

Jun 17, 2009 | Microsoft Windows Vista Ultimate Edition

2 Answers

Cant run turbo c++ with dosbox in vista


Hi , Use This Commands in DosBox : Mount C C:\TC

in DosBox run Tc and go to Option Menu\Directories

replace all paths with this : C:\INCLUDE
C:\LIB
then your Libraries will be found !!

Apr 25, 2009 | Microsoft Windows® Vista 64-bit Business...

1 Answer

I have a hp laptop with windows vista home premium.i want to work on turboc++, but i am unable to do so. kindly giv your assistance.....


Install the software DOSBox ver 0.72 ( 1.2 MB ) (Freeware) from the link below.

http://prdownloads.sourceforge.net/dosbox/DOSBox0.72-win32-installer.exe?download

Before going to the details u have to create a folder (any name will do). Here we name it as Turbo

Copy the TC into the Turbo folder

Run the DOSBox 0.72 from the icon located on the desktop or from the location of the installation folder

Then u are presented with two screens which look like the command prompt in Windows

Now u are presented with two screens. One with a Z prompt. U can ignore the other screen.

There type the following commands at the command prompt [Z]:

Mount [Type in any alphabet that u wish except z] [Type the source of the turbo C] press enter

Now , Type in the following commands after the Z prompt:

Z: mount d c:\Turbo\ [The folder TC is present inside the folder Turbo]

* Now u should get a message which says: Drive D is mounted as a local directory c:\Turbo\ ***

Now type d: to shift to d: prompt .

D: cd TC [The contents inside the folder Turbo gets mounted as a virtual drive (Here D drive)

D: cd Bin

D: TC or Tc.exe [This presents u the Turbo C++3.0 screen]

On the Turbo C++ goto Options>Directories>Change the source of TC to the source directory [D] ( i.e. virtual D: refers to original c:\Turbo\ . So make the path change to something like D:\TC\include and D:\TC\lib respectively )

===========================================================

In order to get the full screen use the key combination of Alt and Enter

When u exit from the DosBox [precisely when u unmount the virtual drive where Turbo C++ 3.0 has been mounted] all the files u have saved or made changes in Turbo C++ 3.0 will be copied into the source directory(The directory which contains TC folder)

It is a good idea to backup your files in the source directory prior to running DOSBox 0.72

For additional help go through the readme file located in the installation folder or look on the website of the DOSBox forum.

The above procedure has been successfully implemented on Windows Vista Ultimate 64 bit

IMP : Don't use shortcut keys to perform operations in TC because they might be a shortuct key for DOSBOX also . Eg : Ctrl+F9 will exit DOSBOX rather running the code

Mar 07, 2009 | Microsoft Windows Vista Ultimate Edition

2 Answers

Not getting the output on the screen


Try writing it like this ...


#include <iostream>
using namespace std;

int main ()
{
cout << "welcome to the world of c++! ";
return 0;
}

Nov 14, 2008 | Microsoft Windows Vista Home Premium with...

2 Answers

Does Vista Support Turbo C/C++??


google vista + turbo c.... you need a program called dosbox and it's a very lenghty explanation but it is possible to do

Aug 25, 2008 | Microsoft Windows Vista Ultimate Edition

1 Answer

Software


Hi,

You could try using DOSBox.

DOSBox is located on the Web at : http://www.dosbox.com/

You can download DOSBox at: http://www.dosbox.com/download.php?main=1

Hope this helps. Thanks!

Sincere-One

Jul 21, 2008 | Microsoft Windows Vista Ultimate Edition

2 Answers

Turbo c doesnt have a full screen version on vista..


FOLLOWS THESE STEPS TO SOLVE THIS PROBLEM...
  1. Copy the “DOSBox0.72-win32-installer.exe” from http://www.download3k.com/Install-DOSBox.html
  1. Install it with default settings.
  2. Create a folder “Turboc” in your C:\> directory.
  3. Copy your turbo c folder such as “TC” in the folder “Turboc”. This is shown in the following diagram.
fifth.jpg?w=625&h=526<!Run the software you installed. Its icon is present on the your desktop.
  1. This will run the software, as shown in the fig:
first.jpg?w=573&h=507<!
Write these lines in the screen:
mount c c:\>Turboc
Press Enter
Following message will appear on the screen
Drive c is mounted as local directory c:\Turboc\
Now write:
C:
Press Enter
Now write:
cd TC
Press Enter,
Now write
cd bin
Press Enter,
Now write
Tc.exe
All these steps are shown in the following figure:
2nd.jpg

8.
Now following screen will appear:

fourth.jpg
10. Press Alt + Enter. Full screen mode of Turbo C will appear.
[updated]IMPORTANT : Don’t use shortcut Ctrl+F9 bcoz it is a shortcut for dos box to exit
Happy Coding

Jul 02, 2008 | Microsoft Windows Vista Ultimate Edition

Not finding what you are looking for?
Computers & Internet Logo

Related Topics:

114 people viewed this question

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Doctor PC
Doctor PC

Level 3 Expert

7733 Answers

kakima

Level 3 Expert

102366 Answers

David Payne
David Payne

Level 3 Expert

14161 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...