Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6074397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:22:39+00:00 2026-05-23T10:22:39+00:00

I need help to identify the bug in my program that I have written

  • 0

I need help to identify the bug in my program that I have written in C. Please bear in mind that I am still learning C. I am trying to implement what I have learned to far. My IDE is MS visual studio 2010.

Here is the program, the program description is written as a comment:

/*The distance between two cities (in km) is input through the keyboard. 
Write a program to convert and print this distance in meters, feet, inches and centimeters*/

#include<stdio.h>
#include<conio.h>

//I have used #include<stdio.h> and #include<conio.h> above


int main()
{
float km, m, cm, ft, inch ;

clrscr();
printf("\nEnter the distance in Kilometers:");
scanf("%f", &km );

// conversions

m=km*1000;
cm=m*100;
inch=cm/2.54;
ft=inch/12;

// displaying the results

printf("\nDistance in meters =%f", m);
printf("\nDistance in centimeters =%f", cm);
printf("\nDistance in feet =%f", ft);
printf("\nDistance in inches = %f", inch);

printf("\n\n\n\n\n\n\nPress any key to exit the program.");
getchar();
return 0;
}

Errors:
1>e:\my documents\visual studio 2010\projects\distance.cpp(32): error C2857: '#include' statement specified with the /YcStdAfx.h command-line option was not found in the source file
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:22:39+00:00Added an answer on May 23, 2026 at 10:22 am

    error C2857: ‘#include’ statement specified with the /YcStdAfx.h command-line option was not found in the source

    This means the compiler (VisualStudio 2010) is forcing the inclusion of StdAfx.h but in the source you are not including it.

    Try adding:

    #include <StdAfx.h>
    

    at the top of your source file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i need help with disk_total_space function.. i have this on my code <?php $sql=select
I need help on regex or preg_match because I am not that experienced yet
I've been trying to formulate a query to help myself identify resource-heavy queries/database/users using
Problem: I need to be able identify when two whitespaces occur consecutively. I have
I have a list of 100,000 domains and I need to identify which ones
I need to be able to identify certain attributes of a JSON response that
I need to figure out which part of a linux program that I am
I have a C code base and need to programmatically identify all of the
I need help :D. I am using web service that returns similar xml file
I need help to discover how to identify how many host addresses are available

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.