search
Log In

Recent questions tagged programming-in-c

1 vote
1 answer
1
Consider the following pseudo-code fragment, where $a$ and $b$ are integer variables that have been initialized: /* Pre-conditions : $(a > 1 \wedge a < b)$ */ /* Assume that overflow never occurs */ int $x=0$; int $p=1$; while $(p<b) \{$ $p=p*a$; $x=x+1$; $\}$ ... $\lfloor \: \: \rfloor$ means floor */ $\lfloor \log_a^b \rfloor$ /* $\lceil \: \: \rceil$ means ceil */
asked Nov 20, 2020 in Programming and DS jothee 178 views
1 vote
1 answer
2
Suppose you are compiling on a machine with $1$-byte chars, $2$-byte shorts, $4$-byte ints, and $8$-byte doubles, and with alignment rules that require the address of every primitive data element to be an integer multiple of the element's size. Suppose further that the compiler is not ... ; double r; int i; } A[10]; /*10 element array of structs */ $150$ bytes $320$ bytes $240$ bytes $200$ bytes
asked Nov 20, 2020 in Programming and DS jothee 127 views
0 votes
0 answers
3
2 votes
0 answers
4
An external variable is globally accessible by all functions has a declaration “extern” associated with it when declared within a function will be initialized to $0$ if not initialized all of these
asked Apr 2, 2020 in Programming Lakshman Patel RJIT 228 views
1 vote
1 answer
5
If initialization is a part of declaration of a structure, then storage class can be automatic register static anything
asked Apr 2, 2020 in Programming Lakshman Patel RJIT 170 views
0 votes
1 answer
6
For $x$ and $y$ are variables as declared below $\textit{double }x=0.005, \: y = – 0.01;$ What is the value of $\text{ceil }(x+y)$, where $\text{ceil }$ is a function to compute ceiling of a number? $1$ $0$ $0.005$ $0.5$
asked Apr 2, 2020 in Programming Lakshman Patel RJIT 147 views
0 votes
1 answer
7
In C programming language, if the first and the second operands of operator $+$ are of types int and float, respectively, the result will be of type int float char long int
asked Apr 2, 2020 in Programming Lakshman Patel RJIT 131 views
0 votes
1 answer
8
What will be the value of $x$ and $y$ after execution of the following statement(C language) n = 5; x = n++; y = -x; $5,-4$ $6,-5$ $6,-6$ $5,-5$
asked Apr 2, 2020 in Programming Lakshman Patel RJIT 119 views
0 votes
1 answer
9
The question is based on the following program fragment. f(intY[10],int x){ int u,j,k; i=0;j=9; do{ k=(i+j)/2; if(Y[k] < x) i=k; else j=k; } while((Y[k]!=x) && (i<j)); if (Y[k]==x) printf( x is in the array. ); else printf( x is not in the array. ); } On which of the following contents of ... $x>2$ $Y$ is $[2\;4\;6\;8\;10\;12\;14\;16\;18\;20]$ and $2<x<20$ and $'x'$ is even
asked Apr 1, 2020 in Programming Lakshman Patel RJIT 408 views
0 votes
1 answer
10
What will be the output of following? main() { Static int a = 3; Printf(“%d”,a--); If(a) main(); } $3$ $3\;2\;1$ $3\;3\;3$ Program will fall in continuous loop and print $3$
asked Apr 1, 2020 in Programming Lakshman Patel RJIT 255 views
0 votes
1 answer
11
The following program fragment prints int i = 5; do { putchar(i+100); printf(“%d”, i--;) } while(i); i5h4g3f2el 14h3g2f1e0 An error message None of the above
asked Apr 1, 2020 in Programming Lakshman Patel RJIT 168 views
1 vote
2 answers
12
The following program fragment prints int i = 5; do { putchar(i+100); printf(“%d”, i--;) } while(i); i5h4g3f2el 14h3g2f1e0 An error message None of the above
asked Apr 1, 2020 in Programming Lakshman Patel RJIT 178 views
0 votes
2 answers
13
What will be the output of following? main() { Static int a = 3; Printf(“%d”,a--); If(a) main(); } $3$ $3\;2\;1$ $3\;3\;3$ Program will fall in continuous loop and print $3$
asked Apr 1, 2020 in Programming Lakshman Patel RJIT 188 views
0 votes
0 answers
14
The question is based on the following program fragment. f(intY[10],int x){ int u,j,k; i=0;j=9; do{ k=(i+j)/2; if(Y[k] < x) i=k; else j=k; } while(Y[k]!=x) && (i<j)); if (Y[k]==x) printf( x is in the array. ); else printf( x is not in the array. ); } On which of the following contents of ... $x>2$ $Y$ is $[2\;4\;6\;8\;10\;12\;14\;16\;18\;20]$ and $2<x<20$ and $'x'$ is even
asked Apr 1, 2020 in Programming Lakshman Patel RJIT 173 views
1 vote
1 answer
15
Which of the following is illegal declaration in $C$ language? char*str ="Raj is a Research scholar"; char str[25] ="Raj is a Research scholar"; char str[40] ="Raj is a Research scholar"; char[]str ="Raj is a Research scholar";
asked Mar 31, 2020 in Programming Lakshman Patel RJIT 407 views
1 vote
3 answers
16
What is the correct way to round off $x$, $a$ $\text{float}$ to an $\text{int}$ value? $y=(\text{int})(x+0.5)$ $y=\text{int} (x+0.5)$ $y=(\text{int}) x+0.5$ $y=(\text{int})(\text{int})x+0.5)$
asked Mar 31, 2020 in Programming Lakshman Patel RJIT 323 views
2 votes
6 answers
17
What error would the following function give on compilation? f(int a, int b) { int a; a=20; return a; } Missing parenthesis is $\textit{return}$ statement. Function should be defined as $\text{int f(int a, int b)}$ Redeclaration of $a$. None of these.
asked Mar 31, 2020 in Programming Lakshman Patel RJIT 751 views
2 votes
1 answer
18
0 votes
1 answer
19
Output of the following loop is for(putchar('c');putchar ('a');putchar('r')) putchar('t'); a syntax error. cartrt. catrat. catratratratrat...
asked Mar 31, 2020 in Programming Lakshman Patel RJIT 287 views
0 votes
0 answers
20
If space occupied by two strings $s_1$ and $s_2$ in 'C' are respectively $m$ and $n$, then space occupied by string obtained by concatenating $s_1$ and $s_2$ is always less than $m+n$ equal to $m+n$ greater than $m+n$ none of these
asked Mar 31, 2020 in Programming Lakshman Patel RJIT 239 views
0 votes
1 answer
21
The maximum combined length of the command-line arguments including the spaces between adjacent arguments is: $128$ characters $256$ characters $67$ characters It may very from one Operating System to another
asked Mar 31, 2020 in Programming Lakshman Patel RJIT 192 views
2 votes
2 answers
22
What is the meaning of following declaration? int(*p[7])(); $p$ is pointer to function $p$ is pointer to such function which return type is array $p$ is array of pointer to function $p$ is pointer to array of function
asked Mar 31, 2020 in Programming Lakshman Patel RJIT 273 views
1 vote
3 answers
23
1 vote
1 answer
24
What will be output if you will compile and execute the following C code? void main(){ char c=125; c=c+10; printf("%d",c); } $135$ $115$ $-121$ $-8$
asked Mar 31, 2020 in Programming Lakshman Patel RJIT 326 views
2 votes
6 answers
25
...