Advertisement

In an occation if u are invited or not, this program will check this.


  #include<conio.h>
  #include<stdio.h>
  #include<math.h>

  void main()
  {
      clrscr();
      int inv,mage,fage,age;
      printf("If invited press 1=");
      scanf("%d",&inv);
      if(inv==1)
     { printf("press 1 for male=");
       scanf("%d",&age);
       if(age==1)
     {  printf("Enter age for male=");
                scanf("%d",&mage);
                if(mage>40)
                {  printf("go");  }
                else
                {  printf("do not go");   }
                     }
      else
       { printf("enter age for female=");
       scanf("%d",&fage);
       if(fage<40)
                {  printf("go");  }
                else
                {  printf("do not go");   }
                     }
                                }
      else
      {printf("you are not invited");}
                                   getch();
                                                                  }

No comments:

Post a Comment

Please comment bellow. Share your knowledge