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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:13:13+00:00 2026-06-11T07:13:13+00:00

I am getting this error when I go to compile the program below, and

  • 0

I am getting this error when I go to compile the program below, and I can’t figure out why.

39:19: error: invalid operands of types ‘const char [5]’ and ‘long long int’ to binary ‘operator&’

Here’s the code.

int
main(void)
{
    long long d, p; 

    // Ask for number for the numbers of  days as long as input is between 28 and 31
    do  
    {
       printf("How many days are in your month?\n");
       scanf("%lld" &d);    // This is the line with the error
    }   
    while (d<28 || d>31);

    // Ask user for number of pennies for day 1 as long as input is not negative
    printf("How many Pennies do you have?\n");
    do
    {
        scanf("%lld", &p);    
    }
    while (p<0);

    //sum up the pennies
    int i;
    for (int i=0; i<=d-1; i++);
    {
        p = (p * 2);
    }

    // Format and print the total  (currently * instead of / for troube-shooting)
    double total;
    total = (p * 100);
    printf("Your ending amount it $%.2f.\n, total");        
}
  • 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-11T07:13:14+00:00Added an answer on June 11, 2026 at 7:13 am

    You forgot a comma in scanf("%lld" &d);. This is causing it to interpret the argument to scanf as the result of some characters BITANDed with a number.

    Change it to:

    scanf("%lld", &d);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone explain why I'm getting this compile error? Duplicate 'Rad.Core.Aop.MethodArgumentValidation' attribute E:\Scripting\Rad.Core\Properties\AssemblyInfo.cs This
I'm getting this error when I try and compile my program on my school's
guys I'm trying to compile my program in c but I'm getting this error
I am getting this error when i try to compile Object-c program in cygwin
I am getting this error during compile time (g++ 4.4.6): main.cpp: In function ‘int
Trying to compile a iPhone/iPad application with SDK3.2 and am getting this error: Undefined
I'm trying to compile the next code, but I'm getting this error on the
Im getting this linker error that won't let me compile. It only happens on
I am getting this weird RunTime error. The classes compile easy on eclipse but
I'm getting a nothing to repeat error when I try to compile this: search

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.