Lets say I have the code below. This program example would ask the user to enter a string of characters, then save those characters into an array named "s1". How can I find out how many characters...
Type: Posts; User: engstudent363
Lets say I have the code below. This program example would ask the user to enter a string of characters, then save those characters into an array named "s1". How can I find out how many characters...
Well sometimes it prints out more than one I'm guessing because %c does something special. What does %c do or mean?
I'm reading in a book and it gave an example where there was a line of code looking like this:
printf("%c", '*');
This prints a certain amount of * but I don't know where it gets the...
I've been stuck on this program trying to get it to work for the past 2 days and haven't gotten it to run properly. I have no idea what I need to do and I need some serious help. If someone can get...
thank you sirs
I know that I use "float" but where do I place the word float so that my program output shows decimals. Right now the program just cuts the decimals off. This program stores how many of each product...
I'm completely stuck. I've thought about this for probably about 4 hours now and can't think of a way to do it. Could someone tell me what I need to do. Here's what I'm trying to accomplish:
Write...
Ok, I was given an assignment that looks like this:
In a menu, ask the user whether they want to calculate the factorial of a non-negative number, or exit. If they choose to calculate the...
Can someone describe to me what a "switch" does?
I want to calculate the factorial of a number and have the results printed on the screen. If the number is -1 the program will exit. If the number is less than -1 the program will give an error...
Also, Is there a command that tells the program to go back to the beginning of the program? Because if the number entered is a negative number then the program exits the while loop and goes to the...
I know what a factorial means, such as if I was given 5! that would mean 5*4*3*2*1 but I don't know how to implement that into my program so that the computer knows to do that.
Assignment:
Part 1: Write a program that requires the user to input a non-negative number and then calculates the factorial of that number and prints the result to the screen. Use a while loop to...
I'm having trouble figuring out how to have the computer calculate a number's factorial and then display it. Also after you enter a negative number I don't know how to return back to the while loop...
I was given this assignment but I'm not really sure where to start. Could someone give me some ideas?
Assignment:
Part 1: Write a program that requires the user to input a non-negative number...