Advertisement
touhid_xml

If else statement in C 7-06_2015

Jul 6th, 2015
491
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3.  
  4. int main(){
  5. int male = 0;
  6.  
  7. /**
  8. red = 1
  9. green = 2
  10. blue = 3
  11. **/
  12. int color = 444;
  13.  
  14. if(color == 1){
  15.     printf("You chose red color");
  16. }else if(color == 2){
  17.       printf("You chose green color");
  18. }else if(color == 3){
  19.           printf("You chose blue color");
  20. }else{
  21.           printf("There is an error choosing color");
  22. }
  23.  
  24.  
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement