Saved Bookmarks
| 1. |
Give the output of the following program:(i) void main() {char *p = "Difficult";char c;c = ++*p++;printf("%c",c);}(ii) #include<iostream.h>static int i = 100;void abc(){static int i = 8;cout<<"first="<<i;}main() {static int i = 2;abc();cout<<"second="<<i<<endl;}(iii) #include<iostream.h>void Print(char *p){p="Pass";cout<<"Value is:"<<p<<end1;}void main(){char *q="Best of Luck";Printf(q);cout<<"New value is:"<<q; |
|
Answer» (i) Output: E (ii) Output: first=8second=2 (iii) Output: Value is: Pass New value is: Best of Luck |
|