Menu bar

Thursday, April 3, 2014

CPU Assignment 3

C.P.U. Assignment 3


1. Explain conditional operator with example

2. Explain operator precedence and associativity

3. Explain break and continue with example

4. Explain various types of loops in c with 
example

5. what do you mean by c tokens. Explain in detail

6. Explain if-else and switch- case with example

7. Explain branching and looping with example code.

8. Explain for-loop differentiate the use of 
continue, break and goto statement

9. Explain if-else-if ladder with flowchart

10. explain various input/output function with example in c

11. compare for, while and do-while with Illustration


Submit the assignment on or before 14-04-2014 

4 comments:

  1. HI,Sir..
    I like to see your blogspot on web.That's the good innovation for our Institute.
    When i want to know about my query in subjects i directly contect to you anytime and anywhere.
    it is such good innovation.
    I requested to you sir please upload our materials of our subjects as soon as.
    and more and more information on our subjects.
    i think change the background on blog.

    ReplyDelete
    Replies
    1. thank you.

      i have changed background hope you like it.

      Delete
  2. Sir,
    In assignment 3: question 8
    How to explain GOTO statement in For loop?

    ReplyDelete
    Replies
    1. The break statement will immediately jump to the end of the current block of code.

      The continue statement will skip the rest of the code in the current loop block and will return to the evaluation part of the loop. In a do or while loop, the condition will be tested and the loop will keep executing or exit as necessary. In a for loop, the counting expression (rightmost part of the for loop declaration) will be evaluated and then the condition will be tested

      Goto allows to make an absolute jump to another point in the program. You should use this feature with caution since its execution causes an unconditional jump ignoring any type of nesting limitations.
      The destination point is identified by a label, which is then used as an argument for the goto statement. A label is made of a valid identifier followed by a colon (:).

      EX:-
      for(i=1;i<10;i++)
      {
      printf("%d",i);
      if(i==5)
      {
      //continue;
      //break;
      //goto asd:
      }
      }
      printf("\n before goto \n");
      asd:
      printf("after goto ");

      when you use continue output will be
      12346789
      before goto
      after goto

      when you use break output will be
      1234
      before goto
      after goto

      when you use goto output will be
      1234
      after goto

      Delete