Most answered questions in Programming in C

#161
4.8k
views
3 answers
7 votes
Consider the following declaration:int a, *b=&a, c=&b;The following program fragmenta=4; c=5;does not change the value of aassigns address of $c$ to $a$assigns the valu...
#163
3.4k
views
3 answers
23 votes
Consider the program where $a, b$ are integers with $b 0$.x:=a; y:=b; z:=0; while y 0 do if odd (x) then z:= z + x; y:= y - 1; else y:= y % 2; x:= 2 * x; fiInvariant of...
#164
6.6k
views
3 answers
4 votes
Let a, b be two positive integers, which of the following options correctly relates / and %?(a) b= (a/b) * b + a%b(b) b= (a%b) * b + a/b(c) a= (a/b) * b + a%b(d) a= (a%b)...
#165
1.1k
views
3 answers
2 votes
given an array of n element, what will be the time complexity to find 1st repeated element when array have more than one repeated elements??
#166
1.7k
views
3 answers
1 votes
what is the output of the following c code?#include<stdio.h void main() { int index; for(index=1;index<=5;index++) { printf("%d",index); if(index==3) continue; } }a)1245b...
#167
3.8k
views
3 answers
2 votes
Which of the following is NOT represented in a subroutine's activation record frame for a stack-based programming language?Values of local variablesReturn addressHeap are...
#168
17.1k
views
3 answers
2 votes
The minimum number of temporary variables needed to swap the contents of two variables is:(a) 1     (b) 2(c) 3     (d) 0
#169
764
views
3 answers
0 votes
main( ){ int i=-4, j, num=10; j = i % -3; j = j?0: num*num; printf(“j = %d”, j); } I tried with the formula $\boxed{\displaystyle \text{Dividend} = \left(\text{Quoti...
#170
4.2k
views
3 answers
0 votes
According to me when we perform the above operations we have to traverse the entire list so then why does it all take constant time ?
#171
3.3k
views
3 answers
2 votes
#172
4.2k
views
3 answers
0 votes
A one dimensional array A has indices 1....75.Each element is a string and takes up three memory words. The array is stored starting at location 1120 decimal. The startin...
#173
1.4k
views
3 answers
2 votes
What is the output of the following $C$ code segment?# define product (a, b) a * b main() { int x=5, y=2; print f("%d", product{x+4, y-3}); }$10$$-9$$15$Error.
#174
9.1k
views
3 answers
44 votes
Consider the following two C code segments. $Y$ and $X$ are one and two dimensional arrays of size $n$ and $ n \times n$ respectively, where $2 \leq n \leq 10$. Assume th...
#175
941
views
3 answers
0 votes
try to print this in one loop itself.i have already done this in two loops(one nested into another).so please try to do in one loop itself.12 43 6 94 8 12 165 ...
#176
6.0k
views
3 answers
22 votes
Choose the correct option to fill the $?1$ and $?2$ so that the program prints an input string in reverse order. Assume that the input string is terminated by a new line ...
#177
12.5k
views
3 answers
30 votes
Consider the following C program which is supposed to compute the transpose of a given $4 \times 4$ matrix $M$. Note that, there is an $X$ in the program which indicates ...
#178
10.0k
views
3 answers
29 votes
Let $x$ be an integer which can take a value of $0$ or $1$. The statementif (x == 0) x = 1; else x = 0;is equivalent to which one of the following ?$x = 1 + x;$$x = 1 - ...
#179
7.7k
views
3 answers
15 votes
Consider the program below in a hypothetical programming language which allows global variables and a choice of static or dynamic scoping.int i; program main() { i = 10; ...
#180
15.2k
views
3 answers
65 votes
Consider the C program given below. What does it print?#include <stdio.h int main () { int i, j; int a [8] = {1, 2, 3, 4, 5, 6, 7, 8}; for(i = 0; i < 3; i++) { a[i] = a[i...