Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #88015

Re: Christmas Quiz 2022

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.c, comp.lang.c++, free.c
Subject Re: Christmas Quiz 2022
Date 2022-12-18 21:22 +0000
Organization A noiseless patient Spider
Message-ID <87zgbkxv8n.fsf@bsb.me.uk> (permalink)
References <tnnspa$27vkp$1@paganini.bofh.team>

Cross-posted to 3 groups.

Show all headers | View raw


Roman P <invalid@example.com> writes:

I now see that this is cross-posted to comp.lang.c++ as well as to
comp.lang.c.  That's not a good idea for quizzes like this.

> 1) What happens when you divide an int variable by 0?

Asking what "happens" in this sort of context is a bit odd, but maybe
clarifying what this might mean is part of the question?

> 2) What happens when you divide a double variable by 0?
> 3) What happens when you overflow an int variable, that is, set it to a 
> value beyond its range?

And here there is even more ambiguity since a variable (what might
better be called a named object) can be set in two ways, and the C
standard says different things about each!

> 4) What is the difference between x = y++; and x = ++y;?
> 5) What is the difference between break, continue, and return when used 
> inside a loop statement?
> 6) What are the three parts of a for statement and which of them are 
> required?

The correct answer for C was made more complicated in 1999, and as for
C++, well that's a whole new ball game.

> 7) What is the difference between the = and == operators?
> 8) Does the following statement compile?
>
> for ( ; ; ) ;
>
> 9) What does the underscore _ represent in a switch expression?

There is no switch expression in C and a switch statement can include
lots of expressions.  But, that aside, I'd like to see what you think
the answer is.

> Merry Christmas to you all.

And to you too.

-- 
Ben.

Back to comp.lang.c++ | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Christmas Quiz 2022 Roman P <invalid@example.com> - 2022-12-18 20:00 +0000
  Re: Christmas Quiz 2022 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-18 21:22 +0000
  Re: Christmas Quiz 2022 red floyd <no.spam.here@its.invalid> - 2022-12-18 13:36 -0800
  Re: Christmas Quiz 2022 "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-12-18 13:48 -0800
    Re: Christmas Quiz 2022 Siri Cruise <chine.bleu@yahoo.com> - 2022-12-18 14:57 -0800
      Re: Christmas Quiz 2022 "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-12-18 15:43 -0800
        Re: Christmas Quiz 2022 Lynn McGuire <lynnmcguire5@gmail.com> - 2022-12-19 23:40 -0600
      Re: Christmas Quiz 2022 "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-12-20 14:01 -0800
  Re: Christmas Quiz 2022 "daniel...@gmail.com" <danielaparker@gmail.com> - 2022-12-18 15:18 -0800
  Re: Christmas Quiz 2022 Kaz Kylheku <864-117-4973@kylheku.com> - 2022-12-20 13:49 +0000
    Re: Christmas Quiz 2022 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-20 14:33 +0000
      Re: Christmas Quiz 2022 Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2022-12-20 14:44 +0000
  Re: Christmas Quiz 2022 Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-12-20 12:46 -0800
    Re: Christmas Quiz 2022 Paavo Helde <eesnimi@osa.pri.ee> - 2022-12-20 23:49 +0200
      Re: Christmas Quiz 2022 Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-12-20 14:00 -0800
        Re: Christmas Quiz 2022 Paavo Helde <eesnimi@osa.pri.ee> - 2022-12-21 00:13 +0200
          Re: Christmas Quiz 2022 Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-12-20 14:38 -0800
    Re: Christmas Quiz 2022 Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-12-20 21:31 -0800
      Re: Christmas Quiz 2022 David Brown <david.brown@hesbynett.no> - 2022-12-21 12:02 +0100

csiph-web