Recent questions tagged programming

–8 votes
0 answers
721
0 votes
0 answers
722
Normally when an object is declared, memory is allocated only for data members.Then,a) Where is the memory for functions is allocated?b) How can a object access its membe...
0 votes
0 answers
723
0 votes
0 answers
725
3 votes
4 answers
731
7 votes
4 answers
733
7 votes
2 answers
734
The value returned by the following function for foo(10) is ____int foo(int x) { if(x < 1) return 1; int sum = 0; for(int i = 1; i <= x; i++) { sum += foo(x-i); } return ...
2 votes
5 answers
736
6 votes
3 answers
739
3 votes
1 answer
741
11 votes
4 answers
742
Which of the following statements produce a compile time error in C?int a = sizeof 3;*(1000) = 5;int a = 5; ((int)a)++;int b = 5, *a = &b; ((int*)a)++;1, 2 and 32 only2, ...
5 votes
4 answers
745
7 votes
2 answers
746
What will be the outout of the following code?#include <stdio.h int main() { int a = 1, b = 2; int c = a++ || b++; printf("%d %d %d", a, b, c); }1 2 12 3 12 2 12 2 0
6 votes
2 answers
749
What is the output of this program?#include <stdio.h int main() { char *ptr; char string[] = "Hello 2017"; ptr = string; ptr += 4; printf("%s",++ptr); }Hello 2017ello 201...