MedVision ad

2014 COMP finals thread. (1 Viewer)

SpiralFlex

Well-Known Member
Joined
Dec 18, 2010
Messages
6,960
Gender
Female
HSC
N/A
Lol this was the same question we got when I did COMP last year.
 

anomalousdecay

Premium Member
Joined
Jan 26, 2013
Messages
5,766
Gender
Male
HSC
2013
AD:

=== Question 9 ===

(4 Marks)

When the following code is compiled and executed it eventually executes
the printf and terminates. What value does it print?


#include <stdio.h>
#define NINE 9

int nine (int Nein);
int nein (int nein);
int main (int argc, char *argv[]) {

...int Nine = 3;
...printf ("%d\n", nine (Nine));
...return !NINE;
}

int nein (int nein) {
...return ( !(nein == ((NINE*nein) % NINE)) );
}

int nine (int Nein) {
...int Nine = NINE;
...while (nein (Nine)) {
......Nine += Nein;
......Nine = Nine % NINE;
...}
...return Nine;
}
I was told this question popped up then someone posted up a hitler vid going "nein, nein,..." in the forums section then Buckland replied to it and everyone lol'ed.

Syntax is so confusing.

But all I got out of it (from a pure guess of the order of events) that the output is 27 or 36.
 

anomalousdecay

Premium Member
Joined
Jan 26, 2013
Messages
5,766
Gender
Male
HSC
2013
AD:

=== Question 9 ===

(4 Marks)

When the following code is compiled and executed it eventually executes
the printf and terminates. What value does it print?


#include <stdio.h>
#define NINE 9

int nine (int Nein);
int nein (int nein);
int main (int argc, char *argv[]) {

...int Nine = 3;
...printf ("%d\n", nine (Nine));
...return !NINE;
}

int nein (int nein) {
...return ( !(nein == ((NINE*nein) % NINE)) );
}

int nine (int Nein) {
...int Nine = NINE;
...while (nein (Nine)) {
......Nine += Nein;
......Nine = Nine % NINE;
...}
...return Nine;
}
After having done a full semester of computing, this question is just lol.

Output is just 9.
 

x3mish

Member
Joined
Jan 23, 2014
Messages
31
Gender
Female
HSC
N/A
thats depressing..are we allowed to enrol into the summer course..even though we don't know if we failed the course yet? cause the summer term seems to start on the 1st of december..while the results wont come out til the 5th?
 

Squar3root

realest nigga
Joined
Jun 10, 2012
Messages
4,927
Location
ya mum gay
Gender
Male
HSC
2025
Uni Grad
2024
thats depressing..are we allowed to enrol into the summer course..even though we don't know if we failed the course yet? cause the summer term seems to start on the 1st of december..while the results wont come out til the 5th?
you can enroll then if you passed just drop it before the census date
 

anomalousdecay

Premium Member
Joined
Jan 26, 2013
Messages
5,766
Gender
Male
HSC
2013
looks like there's some hope...only if my mark assessment was greater than 40..
If you feel that worried and worse comes to worse then if you want to repeat in the summer, enrol in it now and drop before the census date if you passed. I guess its better to prepare for the worst just in case.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top