Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h> /*standard input and output header file*/
- int main()
- {
- printSequence ();
- printf("Again?"); //display Again after the last line
- char userResponse;
- scanf("%c", &userResponse);
- while (c == "Y") {
- printSequence ();
- printf("Again?"); //display Again after the last line
- scanf("%c", &userResponse);
- }
- return 0;
- }
- void printSequence ()
- {
- int counter=1; /*setting the variable to start at 1*/
- while(counter < 6) /*using a while loop to set the counter less than 6*/
- {
- printf("%d\n",counter); /*display the numbers less than 6*/
- counter += 1; /*increment it by 1 anytime the number is displayed*/
- }
- }
Add Comment
Please, Sign In to add comment