0 votes
1685
int f(int &x, int c){c=c-1;if(c==0) return 1;x=x+1;return f(x,c) * x;}What will be the output for f(p,p), if p is initialized to 4.
72 votes
1687
Consider the following functions$f(n) = 3n^{\sqrt{n}}$$g(n) = 2^{\sqrt{n}{\log_{2}n}}$$h(n) = n!$Which of the following is true?$h(n)$ is $O(f(n))$$h(n)$ is $O(g(n))$$g(n...
4 votes
1690
int main(void) { char p[20]; char *s = "Gate015"; int length = strlen(s); int i=0; for(i=0;i<length;i++) p[i]=s[length-i]; printf("%s",p); return 0; }
0 votes
1694
for an arbitrary CFG G, there exist an algorithm a) to check if L(G) contain infinite stringsb) to check which variable appear in some sentential formc) to check which va...
2 votes
1695
A fair coin is tossed 100 times. The Probability of getting 50 heads is close to one of the following numbers:a)0.001b)0.1c)0.3 d)0.4
0 votes
1697
2 votes
1698
main() { int x, y= 100; float *P; P=&y; x=*P; printf("%d", x); }what is output?a) 100b) 1c) 0d) none
3 votes
1699
3 votes
1700
int foo(unsigned int n) { int c,x=0; while(n!=0) { if(n&01) x++; n>>=1; } return c; }
6 votes
1701
int i = 1; int main() { int a[]= { 0,1, 2} ; f(a[i], i); printf("%d", a[i]); } void f(int x, int y) { y++; x=5*i; }In above function f() uses " call by name" technique, w...
2 votes
1702
what are the reasons to use unions or not to use unions in C?why unions in ada are better than C implementation ?
3 votes
1705
1 votes
1706
5 votes
1707
3 votes
1709
Consider a system consisting of n resources of same type being shared by 4 processes, 2 of which need at most 2 resources each and other need at most 3 resources each.Th...
5 votes
1710
10 men and their wives participate in a corporate mixed-doubles tennis championship. What is the probability that no couple play in the second game?0.62220.31110.42850.27...