SHARE
TWEET

Untitled

a guest Jun 19th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
Want to get better at C?
Learn to code C in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top