Recent content by ksepe
-
K
MHB Completing DoublePennies(): Solving the Infinite Loop
The code was provided.. I just have to complete the base case which is what I cannot figure out...- ksepe
- Post #3
- Forum: Programming and Computer Science
-
K
MHB Completing DoublePennies(): Solving the Infinite Loop
Write code to complete DoublePennies()'s base case. Sample output for below program: Number of pennies after 10 days: 1024 The if statement is what I am trying to complete, however this places it in an infinite loop #include <stdio.h> // Returns number of pennies if pennies are doubled...- ksepe
- Thread
- Infinite Loop
- Replies: 4
- Forum: Programming and Computer Science
-
K
MHB Solve C Recursive Case for Factorial Math Formula
I have got the recursive case... I cannot get the output to actually be the factorial (math formula), This is where i am struggling #include <stdio.h> void PrintFactorial(int factCounter, int factValue){ int nextCounter = 0; int nextValue = 0; if (factCounter == 0) { //...- ksepe
- Thread
- Replies: 1
- Forum: Programming and Computer Science
-
K
MHB Checking if PassCode Contains a Digit
Set hasDigit to true if the 3-character passCode contains a digit. My attempt is bolded. It is not recognizing number's #include <stdio.h> #include <string.h> #include <stdbool.h> #include <ctype.h> int main(void) { bool hasDigit = false; char passCode[50] = ""; int valid = 0...- ksepe
- Thread
- Replies: 1
- Forum: Programming and Computer Science
-
K
MHB C String Comparison: Debugging Error - "Hello" Output
I am trying to compare a computer generated word to display the following however, when Quit is entered it produces the output "Hello". What is my error in the code? #include <stdio.h> #include <string.h> int main(void) { char userString[50]; strcpy(userString, "Quit"); /* Your...- ksepe
- Thread
- Comparison String
- Replies: 1
- Forum: Programming and Computer Science