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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:40:04+00:00 2026-05-30T06:40:04+00:00

OUTPUT Fun1 is not fun 9 CODE #include <stdio.h> int fun1(void){ printf(Fun1 is not

  • 0

OUTPUT

Fun1 is not fun
9

CODE

#include <stdio.h>

int fun1(void){
    printf("Fun1 is not fun\n");
    return 45%54/5;
}

main()
{
    int c;
    c=fun1();
    printf("%d\n", c);
}  

QUESTION

Why does it output 9 from the 45%54/5? Would this not output 2? The only way I could see this being 9 is by skipping the %, (modulus division operator, right?) then dividing by 5 omitting the 54 completely but that makes no sense to me.

edit: random secondary question. If I name my file test.c, compile it with cc test.c -o test, then type “test”, nothing happens. If I compile under any other name than test, it works fine. What gives?

  • 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-30T06:40:05+00:00Added an answer on May 30, 2026 at 6:40 am
    45 % 54 / 5
    

    is

    (45 % 54) / 5
    

    Which evaluates as:

    45 % 54 = 45
    45 / 5  = 9
    

    45 mod 54 is equal to 45. I don’t see how you expect to get 2 regardless of how you order them.

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

Sidebar

Related Questions

The output of following program #include<stdio.h> int main(){ int *p[10]; printf(%ld %ld\n,sizeof(*p),sizeof(p)); } is
Output: Hello Why the output isnt Hello World?** #include <stdio.h> int main () {
Can someone help me to understand the output of these program. int* fun1(); void
Output 1 2 null 2 Code class Program { static void Main(String[] args) {
The output of the below code is as following: not equal equal Note the
The output from the following code is incorrect. It should only output the leaves
The output from the code that follows is: java.vendor Sun Microsystems Inc. java.version 1.6.0_26
compiler output: g++ -Wall -g main.cpp `sdl-config --cflags --libs` -lSDL_mixer In file included from
The output we get when printing C++ sources from Eclipse is rather ugly. Is
The output of this echo is not passed on to the next command using

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.