fork download
  1. /**********************************************
  2.  * Purpose: Greeting for new
  3.  * programmers.
  4.  *
  5.  * OUTPUT: Greeting messages "WELCOME TO C"
  6.  *
  7.  * ********************************************/
  8.  
  9. #include<stdio.h>
  10. int main(void)
  11.  
  12. {
  13. int ch; // user choice
  14.  
  15. puts(" Push 1 stars scheme , 2 for squares scheme \n or 3 for a simple greeting (without schemes) : ");
  16. scanf("%d" , &ch);
  17.  
  18. if( ch ==1 )
  19. {
  20. printf("****************\n");
  21. printf("* WELCOME *\n");
  22. printf("* *\n");
  23. printf("* TO *\n");
  24. printf("* *\n");
  25. printf("* C *\n");
  26. printf("****************\n");
  27. }
  28.  
  29. if( ch == 2)
  30. {
  31. printf("----------------\n");
  32. printf("| WELCOME |\n");
  33. printf("| |\n");
  34. printf("| TO |\n");
  35. printf("| |\n");
  36. printf("| C |\n");
  37. printf("----------------\n");
  38. }
  39.  
  40. if( ch == 3)
  41. printf(" WELCOME TO C");
  42.  
  43. if( ch!= 1 || ch!=2 || ch!=3)
  44. {
  45. printf(" Choice does not exist .");
  46. printf(" You are welcome though!!! ");
  47. }
  48.  
  49. return 0;
  50. }
Success #stdin #stdout 0.01s 1724KB
stdin
Standard input is empty
stdout
 Push 1 stars scheme , 2 for squares scheme 
 or 3 for a simple greeting (without schemes) :  
 Choice does not exist . You are welcome though!!!