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

  • Home
  • SEARCH
  • 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 8886697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:37:15+00:00 2026-06-14T21:37:15+00:00

while working on the c project I found the following problem. I declared a

  • 0

while working on the c project I found the following problem.
I declared a float variable and performed scanf operation on it. The sample code is –

<#include stdio.h>    
<#include conio.h>    
void main()    
{
   clrscr();
   float foo;
   scanf(" %f ",&foo);

   //remaining code goes here

   getch();
}

I found that the error is due to the spaces given after and before %f in scanf statement.
But I don’t know what is the reason behind it ?
thanks.

  • 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-06-14T21:37:16+00:00Added an answer on June 14, 2026 at 9:37 pm

    I think this may help you a little.

    the function scanf will read and ignore any whitespace characters encountered before the next non-whitespace character (whitespace characters include spaces, newline and tab characters — see isspace).

    A single whitespace in the format string validates any quantity of 
    whitespace characters extracted from the stream (including none).
    

    Also it should be like #include<stdio.h> not <#include stdio.h>

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

Sidebar

Related Questions

While working on my final project for my AS/400 Course, I encountered this problem
while working on a school project i ran into a problem using javascript to
I've ran into a really weird problem while working on a large project. I
While working on an existing project I suddenly got the following error when trying
While working a project tonight, I ended up using one .js resource file for
While working on an Xcode project i keep getting the spinning wheel while switching
While working on an AppEngine connected Android project, I occasionally have problems with RequestFactory
recently, while working on a db2 -> oracle migration project, we came across this
While writing a login system for a web project Im working on I came
So I have been working on this project for a short while now. I

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.