Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. /* colourloop.c
  2. Author: Sam Dunne
  3. Description: This allows users to enter there 4 favorite colours using a while loop
  4. Date: 7/10/2010 */
  5. #include <stdio.h>
  6.  
  7. int main()
  8. {
  9.  
  10.     char *colour;
  11.  
  12.  
  13.     int i =0;
  14.     while(i<3)
  15.         {
  16.  
  17.     printf("Enter your favorite colour:");
  18.     scanf("%s", colour);
  19.     printf("Your favorite colour is %s \n", colour);
  20.  
  21.         i++;
  22.         }
  23.  
  24. return 0;
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement