Demo : Distance.cpp

  1. Click “start” à “programs” à”Microsoft Visual Studio 2005” à” Microsoft Visual Studio 2005”

  1. Click “File” à “New” à “Project” .

  1. Select “Visual C++” and “Win32 Console Application” and Name the project as “Distance”. Click “OK”button.

  1. Click “Finish” button to load the project.

  1. Delete all the lines in the page displayed and enter the following lines of code.

// distance.cpp

#include<stdio.h>

#include<stdafx.h>

#include"conio.h"

int main()

{

float kms , miles ;

printf("\n Please Enter the Distance in miles to be converted to kms :");

scanf("%f" , & miles);

kms = (miles* 8)/5;

printf("\n The Equivalent distance in kms : %f" , kms );

getch();

return(0);

}

  1. Now that we are done with writing the code, Click“File” à “Save Distance.cpp” .
  1. Now to compile the code click “Build” à” Build Distance”.

  1. To Run the application click “Debug” à “Start Debugging” as follows
  1. In the opened window Enter any milesto be converted to miles and then press “enter” button.

Demo : Distance.cpp

1.  Click “start” à “programs” à”Microsoft Visual Studio .NET 2005” à” Microsoft Visual Studio .NET 2003”

2.  Click “File” à “New” à “Project” .

3.  Select “Visual C++ Projects” and “Win32 Console Project” and Name the project as “Distance”. Click “OK” button.

4.  Click “Finish” button to load the project .

5.  Delete all the lines in the page displayed and enter the following lines of code .

// distance.cpp

#include<stdio.h>

#include<stdafx.h>

#include"conio.h"

int main()

{

float kms , miles ;

printf("\n Please Enter the Distance in miles to be converted to kms :");

scanf("%f" , & miles);

kms = (miles* 8)/5;

printf("\n The Equivalent distance in kms : %f" , kms );

getch();

return(0);

}

6.  Now that we are done with writing the code , Click “File” à “Save Distance.cpp” .

7.  Now to compile the code click “Build” à” Build Distance”.

8.  To Run the application click “Debug” à “Start” as follows

9.  In the opened window Enter any miles to be converted to miles and then press “enter” button.