Home / MCQ Bank / Computer
Computer Classes And Objects In C Plus Plus Difficulty: Medium

What is the correct syntax of accessing a static member of a Class? --------------------------- Example class: class A { public: static int value; } ---------------------------

Select the correct option to test your answer:

More Computer Questions

What will be the output of the following Python code? a="hello" b=list((x.upper(),len(x)) for x in a) print(b) How Exception handling is implemented in the C++ program? Consider the following dynamic programming implementation of the Knapsack problem: #include<stdio.h> int find_max(int a, int b) { if(a > b) return a; return b; } int knapsack(int W, int *wt, int *val,int n) { int ans[n + 1][W + 1]; int itm,w; for(itm = 0; itm <= n; itm++) ans[itm][0] = 0; for(w = 0;w <= W; w++) ans[0][w] = 0; for(itm = 1; itm <= n; itm++) { for(w = 1; w <= W; w++) { if(wt[itm - 1] <= w) ans[itm][w] = ______________; else ans[itm][w] = ans[itm - 1][w]; } } return ans[n][W]; } int main() { int w[] = {10,20,30}, v[] = {60, 100, 120}, W = 50; int ans = knapsack(W, w, v, 3); printf("%d",ans); return 0; } Which of the following lines completes the above code? What will be the output of the following PHP code ? <?php $i = 5 ; while (-- $i > 0 && ++ $i ) { print $i; } ?> What are the applications of dequeue?