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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:45:24+00:00 2026-05-19T15:45:24+00:00

THIS IS HOMEWORK. thought i’d let you know. if you could point me in

  • 0

THIS IS HOMEWORK. thought i’d let you know. if you could point me in the direction that would help me discover why this error is happening, i’d appreciate it.
http://pastebin.com/hDUpfrsu is my current code (included below). why does it return ONE when i enter (in this order) 5, 6, 7 or other sequences?

#include <stdio.h>
#include <simpio.h>
#include <genlib.h>

/* finds the minimum among three integers using minimal amount of relational operations */

int main()
{
    int myNumbers[2];
    bool lowest;
    printf("Enter the first integer...\t");
    myNumbers[0] = GetInteger();
    printf("Enter the second integer...\t");
    myNumbers[1] = GetInteger();
    printf("Enter the third integer...\t");
    myNumbers[2] = GetInteger();

    if (myNumbers[0] < myNumbers[1] && myNumbers[0] < myNumbers[2])
    {
       lowest = myNumbers[0];
    }

    if (myNumbers[0] > myNumbers[1] && myNumbers[1] < myNumbers[2])
    {
       lowest = myNumbers[1];
    }

    if (myNumbers[0] > myNumbers[2] && myNumbers[1] > myNumbers[2])
    {
       lowest = myNumbers[2];
    }

    printf("\n%d", lowest);
    getchar();
    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-05-19T15:45:24+00:00Added an answer on May 19, 2026 at 3:45 pm

    A few issues:

    • lowest is defined as a bool, it should be an int with how you are using it

    • myNumbers[2] is an array of size 2, it can only hold 2 numbers. Change the size declaration to 3.

    • Consider what would happen if two or more of the values were equal…
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off, let me say that this is not homework (I am an A-Level
I'm working on this homework that's kind of confusing me... I am provided with
Basically i am having problems with my code - this is homework so would
This is my homework and I have thought a lot about it but I
This is a question for a homework problem that I cant figure out: Question
I know you guys hate helping with homework, but I thought I might ask
So I'll be honest, this is for a homework assignment. I know how to
I know this is simple, but I don't really understand the homework-question: Assume the
This is homework, just so that's mentioned. I have project called AdventCalendar, which is
(No, this isn't a homework assignment, I just found the bug and thought it

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.