Sign in to follow this  
Followers 0
Terabojin

swich, no output

27 posts in this topic

Okay, after much thought and concentration, I FIXED IT!!! BOOYEAH!  (sorry about the excitement, but I'm so happy!!!)

 

Here is what I did:

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
 
void main()

{

	unsigned int num;
	printf("What number doest thou wish, between 1 and 5 (0 to exit):\n");
	scanf("%d", &num);

	switch(num)

{
	case 1:
	printf("One shall be the number thou shalt count, and the number of they counting shall be three.\n", num);
	break;

	case 2:
	printf("Neither thou count Two, 'cepting that thou then proceed to Three.\n", num);
	break;

	case 3:
	printf("Three shall be the number thouh shalt count, and the number of thy counting shall be three.\n", num);
	break;

	case 4:
	printf("Four thou shall not count, neither count til two.\n", num);
	break;

	case 5:
	printf("Five is RIGHT OUT.\n", num);
	break;

	case 0:
	printf("Amen\n", num);
	break;

	default:
	printf("That is not a correct choice, please try again\n");
	break;
}

}

Everything works flawlessly thanks to your help and a friend of mine helping me figure out where I went wrong.  Again, thank you for all of your help and patience with me.  This has not been easy for me to go from pure user with no experience whatsoever to writing code.

Share this post


Link to post
Share on other sites

Well now you don't have a loop anymore, so the program only ever asks one question: is this what you want? Looks like you were confusing loops and switch statements and never really intended to use a loop in the first place. Anyway, glad you figured it out. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.