#include <stdio.h>
int main (void)
{
char declarationofindependence[] = "When in the Course of human events...";
printf("%s\n", declarationofindependence);
return 0;
}
because we were talking about declarations in class (though I think that might not be?)
=========================================
//Prints dance to the screen using a switch and break statements then prints break
#include <stdio.h>
int main(void)
{
int breakdance;
printf("Enter a number of times from 1 to 5 to print dance: ");
scanf("%d", &breakdance);
switch (breakdance)
{
case 1: printf("Dance\n"); break;
case 2: printf("Dance\nDance\n"); break;
case 3: printf("Dance\nDance\nDance\n"); break;
case 4: printf("Dance\nDance\nDance\nDance\n"); break;
case 5: printf("Dance\nDance\nDance\nDance\nDance\n"); break;
default: printf("\n"); break;
}
printf("Break\n");
return 0;
}
because we were talking about breaks in class
Feel free to also post your joke programs or ones you like.
Joke programs from my cs 135 class
Moderators: phlip, Moderators General, Prelates
Joke programs from my cs 135 class
There is no emotion more useless in life than hate.
-
- Posts: 63
- Joined: Mon Jun 15, 2009 9:56 pm UTC
- Location: Prague, Czech Republic
Re: Joke programs from my cs 135 class
Text adventure game (for two players):
Code: Select all
10 INPUT a$
20 PRINT a$
30 GO TO 10
Who is online
Users browsing this forum: No registered users and 4 guests