Recent questions and answers in Programming and DS

0 votes
0 answers
1
0 votes
0 answers
3
0 votes
2 answers
8
#include <stdio.h int main() { int a[3] = {1, 3, 5, 7, 9, 11}; int *ptr = a[0]; ptr += sizeof(int); printf("%d", *ptr); return 0; }(Assume size of int to be $2$ bytes.)T...
1 votes
2 answers
10
#include<stdio.h>#define ADD(a,b)(a+b)#define SQUARE(x)(x*x)int main(){int x=2;int y=3;int z = ADD(SQUARE(x++),y);printf("%d\n",z);return 0;}What is the output of the abo...
1 votes
0 answers
14
Consider an integer upper triangular 2D array arr[–8 to +7][–8 to +7] having base address 1000. If the size of the integer is 4 bytes, the address of the element pres...
2 votes
2 answers
15
​​Consider the following $\mathrm{C}$ function definition.int f (int x, int y){ for (int i=0 ; i<y ; i++ ) { x= x + x + y; } return x; }Which of the following stateme...
0 votes
2 answers
18
What is the output of the below code?#include <stdio.h void main() { static int var = 5; printf("%d ", var ); if (var) main(); }a. 1 2 3 4 5b. 1c. 5 4 3 2 1d. Error
1 votes
1 answer
19
int bar(int val){int x=0;while(val 0){x=x+bar(val -1);}return val;}Q: For bar(3) this function is supposed to be stuck in an infinite loop but I do not know how please c...
1 votes
2 answers
21
0 votes
1 answer
27
3 votes
0 answers
28
My question is that can we use command line arguments without use of main function's parameters argc and *argv?
48 votes
8 answers
30
0 votes
0 answers
31
 I have a question that can we use command line arguments without main function arguments?int main(int argc, char argv){}
0 votes
1 answer
32
2 votes
2 answers
33
let x be an array of integer . which of the following can not be present in the left hand side of an assignment statementa)x b) x+i c) * (x+i) d) &x[i]
1 votes
1 answer
35
1 votes
1 answer
36
Does C support fractional Indices?float x = some fraction;Is float a[x] valid declaration?
0 votes
1 answer
40
Find the error of the following IP addresses. If the IP is valid, check its Class and determine whether the address is Unicast or Multicast.i) 237.15.2.1ii) 256.1.8.9iii)...
To see more, click for all the questions in this category.