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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:46:16+00:00 2026-06-18T04:46:16+00:00

This little bit of C code is driving me nuts. It asks for the

  • 0

This little bit of C code is driving me nuts. It asks for the Input Voltage but then it skips Resistor 1 and asks for Resistor 2. I’m missing something extremely obvious here… What the heck is going on…

#include <stdio.h>
int main() 
{
    float Vin;
    int R1;  
    int R2;

    printf("Input Voltage: ");
    scanf("%.3f", &Vin);

    printf("\nResistor 1: ");
    scanf("%d", &R1);

    printf("\nResistor 2: ");
    scanf("%d", &R2);

    return(0);
}
  • 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-18T04:46:17+00:00Added an answer on June 18, 2026 at 4:46 am

    Remove the .3 part:

    scanf("%f", &Vin);
    

    It does not really make sense to configure the number of decimal digits for input 🙂 Therefore, scanf does not support it. A float always has 8 decimal digits. Crank up your compiler’s warning levels.

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

Sidebar

Related Questions

I have this little bit of code for a fade in effect but for
its a little bit hard to understand. in the header.php i have this code:
Maybe this sounds a little bit crazy, but I need to come up with
This question may seem a little bit stackoverflow-implementation specific, but I have seen a
This might be a little bit odd question, but Im trying to figure out
This might be a little bit picky, but in the iPad SplitViewController setup, there
I only read a little bit about this topic, but it seems that the
I feel a little bit silly asking this, but I haven't been able to
I have a little bit of code in my model that looks like this:
This little bit of code will help me describe my problem: public class Car

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.