Recent questions in Programming and DS

0 votes
0 answers
1
1 votes
2 answers
3
#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
4
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...
0 votes
2 answers
5
0 votes
2 answers
8
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
9
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...
3 votes
0 answers
10
My question is that can we use command line arguments without use of main function's parameters argc and *argv?
0 votes
0 answers
11
 I have a question that can we use command line arguments without main function arguments?int main(int argc, char argv){}
2 votes
1 answer
13
#include <stdio.h int main() { int i = -1; int x = (unsigned char)i; printf("%d", x); return 0; }output is 255 , but please explain how
0 votes
1 answer
15
How can we find the highest element in a singly linked list in O(1)? We are free to use any extra space.
0 votes
1 answer
16
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)...