Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Alejandro Reyes
Courses Plus Student 1,927 PointsFuzzBizzNezz
I'm writing a program that takes three integer inputs: "Fuzz", "Bizz", and "Nezz".
Print numbers from 1 to the user's input for "Nezz". For the multiples of "Fuzz", print "Fuzz" instead of the number and for the multiples of "Bizz", print "Bizz" instead of the number. For numbers which are multiples of both "Fuzz" and "Bizz" print " FuzzBizz"
This is a working program and it's what I'm going for, but there are some things I don't get;
include <stdio.h>
include <stdlib.h>
int main() {
char nezzChar[4]; β //
Why is it a char and not an int? Why is there an array of characters instead of just one value?
\ printf("Choose a number between 100 and 999 for Nezz and press [Enter]\n"); gets(nezzChar);
char fuzzChar[4];
printf("Choose a 1-digit number for Fuzz and press [Enter]:\n");
gets(fuzzChar);
char bizzChar[4];
printf("Choose a 1-digit number for Bizz and press [Enter]:\n");
gets(bizzChar);
int fuzz = atoi(fuzzChar); int bizz = atoi(bizzChar); int nezz = atoi(nezzChar); //
This converts char to int right? But why canβt the input be an int already?
\
int x; //
I donΒ΄t get this loop, when did x became Nezz?
\ for (x = 1; x <= nezz; x++) {
if (x % fuzz == 0 & x % bizz == 0) {
printf("FuzzBizz\n");
}
else if (x % fuzz == 0) {
printf("Fuzz\n");
} else if (x % bizz == 0) {
printf("Bizz\n");
} else {
printf("%d\n", x);
}
}
}
Thanks for your help!