Ppl home assignment_unit2

326 views

Published on

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
326
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Ppl home assignment_unit2

  1. 1. Bansilal Ramnath Agarwal Charitable Trust’s Vishwakarma Institute of Technology, Pune. 37 Principles of Programming Languages CS 20105 – SE – E Home Assignment 2Assignment Date: 13th March 2012 Submission Date: 20th March 2012Answer all 13 questions:1. What are Imperative Languages? Is there any difference between ImperativeLanguages and Procedural Languages?2. What is meant by operator associativity and operator precedence? If x, yand z have values 40, 4 and 10 respectively, what will be the values of x, y andz after executing the following statement:z+=(x>20 && x<=50)?x++:x/y;3. What will be the output of following C code: #include <stdio.h> int main() { int i=1; if(!i) printf(“Hin”); else { i=0; printf(“Hellon”); main(); } return 0; } Page 1 of 2
  2. 2. 4. What will be the output of following C code:#include <stdio.h>int main() { int i=5; while (i<10); { printf(“%d “,i); i++; } printf(“%d”, i); return 0;}5. True or False? (for C language)a. Whatever you can do using ‘for’ you can also do using ‘while’b. Switch-Case always works for constant integer valuesc. Size of a pointer to int is 2 bytes while size of a pointer to char is 1byted. Pointers in C are primitive types6. What is the difference between a “strongly typed” language and a “weeklytyped” language?7. When do you use “structures” and when do you use “union” in C? Explainwith examples.8. If p is declared as a pointer to an integer, is there any difference between*p++ and (*p)++?9. What is a “reference” type in C++?10. What is meant by “parameter passing”? What are some parameter passingmethods generally used?11. What does an “Activation Record” contain?12. What are generic templates in C++ and what is their use? Explain with anexample.13. What are containers, algorithms and iterators in C++ STL? What are theyused for? Page 2 of 2

×