hey
im new here and i have an exam tomorrow so i need to learn how to do this!!!
the question is to write a program that prompts the user to enter a value, with a message then being displayed that is dependent on teh value entered....
the message should be 1 = happy first birthday
17 = you can learn how to drive
30 = still young
40 = getting older
so far i got:
Code:
#include<stdio.h>
#include<stdlib.h>
#include <CLIB.H>
main()
{
int c;
printf("Enter value: \n");
while (1)
scanf("%d",&c);
switch(c)
{
case 1: printf("hello you");
break;
case 17: printf("you can learn to drive");
break;
case 30: printf("still young");
break;
case 40: printf("getting older");
break;
}
return 0;
}
what am i doing wrong?
thanks