Welcome to Instructbd

Monday, 22 February 2016

Programming Problem, solve Programming Problem, Programming, Programming Practice,

Note: At First, Solve this Programme Without Using Computer. Then run it in your Computer to Check your Answer.


(a) when x is given as 1, 5, 0 respectively ?
     #include <stdio.h>
       int main()
     {
        int x;
        scanf(“%d”,&x);
        switch(x!=5){
                 case 0:
                             printf(“A”);
                             break;
                 case 1:
                             printf(“B”);
                             break;
                 case 2:
                             printf(“B”);
                             break;
                 default:
                             printf(“C”);
         }
    return 0;
     }


b)
      #include <stdio.h>
        int main()
     {
         int x=5;
         switch(x!=0)
      {
              case 0:
                          printf(“Red”);
                          break;
             case 1:
                         printf(“Green”);
             default:
                         printf(“Blue”);
                         break;
        }

 return 0;
}


If you encounter any problem to solve this programme. Please let us know, we'll help you to solve those programme
Reactions:

1 comment:

Followers

Follow by Email

Onclick Anti-adblock

Search This Blog

Popular Posts

Blog Archive