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 8926187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:54:29+00:00 2026-06-15T07:54:29+00:00

I was wondering why does my scanf keep going when I just ask for

  • 0

I was wondering why does my scanf keep going when I just ask for two parameters?

do {
    scanf("%f %f\n", &a,&b);
    printf("a=%f; b=%f;\n",a,b);
    printf("f(a)=%f; f(b)=%f; f(a)*f(b)=%f;\n",f(a),f(b),f(a)*f(b));
}
while(a>=b || f(a)*f(b)>=0);

1
2
3
a=1.000000; b=2.000000;
f(a)=-3.281718; f(b)=-0.610944; f(a)*f(b)=2.004947;
1 5
a=3.000000; b=1.000000;
f(a)=10.085535; f(b)=-3.281718; f(a)*f(b)=-33.097884;

Thank you in advance

  • 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-15T07:54:30+00:00Added an answer on June 15, 2026 at 7:54 am
    scanf("%f %f \n ", &a,&b);
    

    The \n at the end makes the scanf ignore the first newline character which would have otherwise terminated input.

    This will work fine :

      scanf("%f %f ", &a,&b);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just wondering how does apple approve the iPhone app that communicates via
Just wondering does the 4GB limit apply to this edition or is it 'fully
I am wondering how does the standard C library function scanf() check if the
I've been wondering how scanf()/printf() actually works in the hardware and OS levels. Where
Just wondering does anybody know the default location for .mdmp/.hdmp files on Windows Server
I am using gcc 4.4.2 on linux I am just wondering does gcc automatically
I was just wondering how does data loads for Twitter and Facebook apps.. Like
I was just wondering how does the container select which package to load a
I was wondering does anyone know if its possible to open a wifi and
I am wondering does the size() function returns an internal stored variable (which gives

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.