Recent questions tagged programming-in-c

0 0 votes
0 0 answers
104
104 views
Consider a group of N stations share a $56$-kbps pure ALOHA channel. Each station sends a $1000$-bit frame on average once every $100$ seconds, regardless of whether the ...
0 0 votes
0 0 answers
149
149 views
A network on the Internet has a subnet mask of $255.255.240.0$. What is the maximum number of hosts it can handle?$4096$$4086$$4069$$4068$
0 0 votes
0 0 answers
103
103 views
Which of the following key size is used in triple Data Encryption Standard ($3$DES)?$56$-bit$128$-bit$168$-bit$256$-bit
0 0 votes
0 0 answers
138
138 views
Which one of the following statements correctly describes the difference between the DOM and SAX approaches to XML processing ?DOM reads and processes an XML document by ...
0 0 votes
0 0 answers
129
129 views
Which of the following software development models is/are path-based integration testing compatible with?Only traditional waterfall modelsOnly agile modelsOnly object-ori...
0 0 votes
0 0 answers
114
114 views
Which one of the following occurs when no transition is enabled in a traditional Petri net?DeadlockSystem resetEvent initializationInput-output synchronization 
1 1 vote
2 2 answers
576
576 views
#include<stdio.h int main() { static int GATE[]={100,200,300,400,500}; static int *p[] = {GATE+2, GATE, GATE+3, GATE+4, GATE+1}; int ptr = p; ptr++; ...
0 0 votes
0 0 answers
457
457 views
#include<stdio.h int main() { int a[] = {{1, 2},{ 3, 4}}; int i, j; int *p[] = { a, a+1, a+2}; for(i=0; i<2; i++) for(j=0; j<2; j++) printf("%d, %d, %d, %d\n", *(*(p+i)+...
1 1 vote
1 1 answer
633
633 views
Which of the following defines a variable ‘a’ as an array of pointers to integers? (a) int *b[10], a[10]; (b) int *b, a[10]; (c) int b, *a[10]; (d) int b, (*a)[10];I got ...
1 1 vote
1 answers 1 answer
491
491 views
What size should we use for Pointers for GATE? Pointers are architecture dependent so they have variable size so which architecture's pointer size should we assume?
1 1 vote
0 0 answers
172
172 views
Consider the following C code (for 32 bit machine)#include int main() {struct node { int a; //Assume integer is 4 bytes longchar b; //Assume character is 1 bytes longdoub...
2 2 votes
2 2 answers
598
598 views
What will be the output of the C program? #include int main() { int size = sizeof(volatile) + sizeof(const); printf("%d",++size); return 0; } (a)8 (b)10 (c)9 (d)Compilati...
2 2 votes
1 1 answer
482
482 views
Consider the following piece of C programming code:int x=128, y=110; do { If(x>y) x=x-y; else y=y-x; } while (x!=y) printf("%d",x);Which one will be the output?$18$$2$$92...
0 0 votes
1 1 answer
391
391 views
What will be the output of the following C programming code:int i, j; for(i=1; i<5; i+=2) for(j=1; j<i; j+=2) printf("%d", j);$1$$1 \quad 2$$1 \quad 3$$1 \quad 1 \quad 3$
1 1 vote
2 2 answers
545
545 views
What would be the equivalent pointer expression for referring the array element $\operatorname{ar}[\mathrm{m}][\mathrm{n}][\mathrm{o}]$$^* (^* (^* (\operatorname{ar})+\ma...
0 0 votes
1 1 answer
518
518 views
What will be the output of the following C Programming code:void main () { int * i, a=12, b=2, c ; c=(a=a+b, b=a/b, a=a*b, b=a-b) i=& c ; printf("%d", (*i)); }$91$$90$$9...
2 2 votes
1 1 answer
328
328 views
Consider the operators used in C Programming given below:$\&\&$$+=$$>>$$>=$$?\colon$Choose among the following the correct order of precedence of the operators given abov...
0 0 votes
2 2 answers
309
309 views
Only legal pointer operations:pointer $+$ number $\rightarrow$ pointerpointer $-$ number $\rightarrow$ numberpointer $+$ pointer $\rightarrow$ pointerpointer $-$ pointer ...
0 0 votes
2 2 answers
502
502 views
Match List I with List II$\begin{array}{|ll|ll|} \hline & \textbf{List I} & & \textbf{List II} \\ \hline \text{A.} & \text{Overloading} & \text{I.} & \text{Since function...
0 0 votes
1 1 answer
279
279 views
Which of the following is not true about Global Variables:The values of the Global variables which are sent to the called function may be changed inadvertently by the cal...
0 0 votes
1 1 answer
246
246 views
Consider the following statements$\begin{array}{l} \operatorname{int} x=10, y=15; \\ x=((x=y) ?(y+x):(y-x)); \end{array}$What will be the value of $x$ after executing the...
0 0 votes
1 1 answer
390
390 views
Consider following conditional statements if $(\mathrm{m}==20-10 \| \mathrm{n}>10)$. The order of execution of the following operations is$==$$-$$\mid \mid$$>$Choose the ...
0 0 votes
1 1 answer
286
286 views
Match the LIST-I with LIST-II$\begin{array}{|l|l|l|l|} \hline & \textbf{LIST-I} & & \textbf{LIST-II} \\ & \textbf{(FUNCTIONS)} && \textbf{(Uses of functions)} \\ \hline \...
0 0 votes
1 1 answer
196
196 views
Which of the following statements $\text{I-IV}$ are true with reference to high-level computer programming languages?These need to be translated into machine code in orde...
1 1 vote
2 2 answers
398
398 views
#include<stdio.h void main() { int arr[]={1, 2, 3, 4, 5}; int *p=arr; printf("%d", *p++); printf("%d", *(p+1)); }Find the output of the above code?$1,2$$1,3$$2,3$$1,4$
0 0 votes
1 1 answer
303
303 views
Consider the following C code:#include<stdio.h int temp = 0; int fun(int x, int y) { int z; temp++; if (y==3) return(x*x*x); else { z=fun(x, y/3); return(z*z*z); } } int ...
0 0 votes
1 1 answer
242
242 views
#include<iostream.h using namespace std; void swap(int &x, int &y) { int temp = x; x=y; y= temp; } int main() { int a=5,b=10; swap(a,b); swap(a,b); cout<<a<<" " <<b; retu...
0 0 votes
1 1 answer
378
378 views
Consider the function in $C$ code:Cal(a,b) { if (b!=1) { if (a!=1) { printf("*"); Cal(a/2, b); } else { b=b-1; Cal(10,b); } }}How many times $*$ is going to be printed, i...
0 0 votes
2 2 answers
393
393 views
Consider the following code:#include<stdio.h void f1(char *x, char *y) { char *t1; t 1 = x; x= y; y = t 1;} void f2(char x, char y) { char *t1 ; t1 = *x; *x = *y; *y = ...
0 0 votes
1 1 answer
347
347 views
Consider following C program :#include<stdio.h int main() { int x[]={2,4,6,8,10}; int a, b=0, * y = x+4; for(a = 0; a<5; a++) { b=b+(*y -a) - *(y -a); } printf("%d\n", b)...