Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage for Programming:
Recent questions tagged programming
2
votes
2
answers
361
program output - C
Consider the following program int find (int n) { int a = 1; for (i = 1; i < = n; i ++) for (j = 1; j < = i; j++) for (k = 1; k <= j, k++) a = a + 1; return a; } The value returned by find (9) is ______ .
Consider the following programint find (int n) { int a = 1; for (i = 1; i < = n; i ++) for (j = 1; j < = i; j++) for (k = 1; k <= j, k++) a = a + 1; ...
atulcse
662
views
atulcse
asked
Jan 15, 2022
Programming in C
programming-in-c
output
programming
+
–
0
votes
1
answer
362
APPLIED GATE TEST SERIES
What is the output of the following c-code ? A.It prints the APPLIED B.It prints the DEILPPA C.It prints nothing D.None of the above
What is the output of the following c-code ? A.It prints the APPLIED B.It prints the DEILPPA C.It prints nothing D.None of the above
its_vaibhav
280
views
its_vaibhav
asked
Jan 13, 2022
Programming in C
test-series
programming
+
–
0
votes
1
answer
363
APPLIED GATE TEST SERIES
applied gate test series What is the output of the following c-code[ Note: Assume integer as 2 bytes] ? #include<stdio.h> int main() { int x = 500; char *p=&x; *++p=2; printf(“%d”,x); return 0; }
applied gate test seriesWhat is the output of the following c-code[ Note: Assume integer as 2 bytes] ?#include<stdio.h>int main(){ int x = 500;char *p=&x;*++p=2;printf(�...
its_vaibhav
592
views
its_vaibhav
asked
Jan 12, 2022
Programming in C
programming
test-series
numerical-answers
+
–
0
votes
1
answer
364
In my mind
#include<stdio.h> Int main(void){ Int a=printf("%d",printf("%d %d",printf("GATE"),printf("OVERFLOW"))); printf("%d",a); return 0; } What is the reason for different output? Explain ideas.
#include<stdio.h>Int main(void){Int a=printf("%d",printf("%d %d",printf("GATE"),printf("OVERFLOW")));printf("%d",a);return 0;}What is the reason for different output?Expl...
SÀRÁTH_2003
441
views
SÀRÁTH_2003
asked
Jan 7, 2022
Programming in C
programming
programming-in-c
functions
descriptive
+
–
0
votes
3
answers
365
ACE Test Series:C-program
What should be the ans. Isn’t the Function initialization should be outside main function? They are given inside main. If declaration would be outside main then ans should be C else i don’t think options are correct here. Anyone ?
What should be the ans. Isn’t the Function initialization should be outside main function? They are given inside main. If declaration would be outside main then ans sho...
ramakrushna
687
views
ramakrushna
asked
Dec 23, 2021
Programming in C
programming-in-c
ace-test-series
output
programming
+
–
0
votes
3
answers
366
&* Operator in C
#include <stdio.h> int main() { int a=20; int *ptr=&a; int x=a; printf ("%p\n",&*ptr); printf ("%p\n",&a); return 0; } Why both printf() line printing the same address value??
#include <stdio.h>int main(){ int a=20; int *ptr=&a; int x=a; printf ("%p\n",&*ptr); printf ("%p\n",&a); return 0;}Why both printf() line printing the s...
lalitver10
667
views
lalitver10
asked
Oct 23, 2021
Programming in C
programming
programming-in-c
pointers
+
–
2
votes
2
answers
367
TIFR CSE 2021 | Part B | Question: 6
Consider the following pseudocode: procedure HowManyDash(n) if n=0 then print '-' else if n=1 then print '-' else HowManyDash(n-1) HowManyDash(n-2) end if end procedure How many ‘-’ does HowManyDash$(10)$ print? $9$ $10$ $55$ $89$ $1024$
Consider the following pseudocode:procedure HowManyDash(n) if n=0 then print '-' else if n=1 then print '-' else HowManyDash(n-1) HowManyDash(n-2) end if end procedureHow...
soujanyareddy13
512
views
soujanyareddy13
asked
Mar 25, 2021
Programming in C
tifr2021
programming
recursion
+
–
1
votes
3
answers
368
NIELIT 2017 OCT Scientific Assistant A (IT) - Section B: 29
Consider the following declaration. int a, *b = &a, **c = &b; a = 4; **c = 5; If the statement b = (int *)**c Is appended to the above program fragment then Value of $b$ becomes $5$ Value of $b$ will be the address of $c$ Value of $b$ is unaffected None of these
Consider the following declaration.int a, *b = &a, c = &b; a = 4; c = 5;If the statementb = (int *) cIs appended to the above program fragment thenValue of $b$ becomes ...
admin
900
views
admin
asked
Apr 1, 2020
Programming in C
nielit2017oct-assistanta-it
programming
pointers
+
–
4
votes
1
answer
369
NIELIT 2016 MAR Scientist B - Section C: 45
Control structures include iteration rendezvous statements exception statements all of these
Control structures includeiterationrendezvous statementsexception statementsall of these
admin
1.6k
views
admin
asked
Mar 31, 2020
Programming in C
nielit2016mar-scientistb
programming
+
–
2
votes
1
answer
370
NIELIT 2016 DEC Scientist B (IT) - Section B: 25
The keyboard used to transfer control from a function back to the calling function is: switch go to go back return
The keyboard used to transfer control from a function back to the calling function is:switchgo togo backreturn
admin
802
views
admin
asked
Mar 31, 2020
Programming in C
nielit2016dec-scientistb-it
programming
functions
+
–
3
votes
1
answer
371
NIELIT 2017 July Scientist B (IT) - Section B: 26
The following program is to be tested for statement coverage: begin if(a==b){S1;exit;} else if (c==d){S2;} else{S3;exit;} S4; end The test cases $T1,T2,T3$ and $T4$ given below are expressed in terms of the properties satisfied by the ... given below ensures coverage of statements $S1,S2,S3$ and $S4$? $T_1,T_2,T_3$ $T_2,T_4$ $T_3,T_4$ $T_1,T_2,T_4$
The following program is to be tested for statement coverage: begin if(a==b){S1;exit;} else if (c==d){S2;} else{S3;exit;} S4; endThe test cases $T1,T2,T3$ and $T4$ given ...
admin
672
views
admin
asked
Mar 30, 2020
Programming in C
nielit2017july-scientistb-it
programming
+
–
1
votes
1
answer
372
NIELIT 2017 July Scientist B (IT) - Section B: 37
Consider the following C declaration struct { short s[5]; union { float y; long z; }u; }t; Assume that objects of the type short, float and long occupy $2$ bytes, $4$ bytes and $8$ bytes respectively. The memory requirement for variable $t$ ignoring alignment considerations, is $22$ bytes $14$ bytes $18$ bytes $10$ bytes
Consider the following C declaration struct { short s[5]; union { float y; long z; }u; }t;Assume that objects of the type short, float and long occupy $2$ bytes, $4$ byte...
admin
621
views
admin
asked
Mar 30, 2020
Programming in C
nielit2017july-scientistb-it
programming
+
–
2
votes
4
answers
373
NIELIT 2017 July Scientist B (CS) - Section B: 58
Bug means A logical error in a program A difficult syntax error in a program Documenting programs using an efficient documentation tool All of the above
Bug meansA logical error in a programA difficult syntax error in a programDocumenting programs using an efficient documentation toolAll of the above
admin
1.6k
views
admin
asked
Mar 30, 2020
Programming in C
nielit2017july-scientistb-cs
programming
+
–
0
votes
3
answers
374
UGC NET CSE | January 2017 | Part 3 | Question: 42
What can you say about the following statements? XML tags are case-insensitive In JavaScript, identifier names are case-sensitive Cascading Style Sheets (CSS) cannot be used with XML All well formed XML documents must contain a document type definition ... II are false only III and IV are false only I and III are false only II and IV are false
What can you say about the following statements?XML tags are case-insensitiveIn JavaScript, identifier names are case-sensitiveCascading Style Sheets (CSS) cannot be used...
go_editor
1.8k
views
go_editor
asked
Mar 24, 2020
Web Technologies
ugcnetcse-jan2017-paper3
web-technologies
programming
+
–
5
votes
3
answers
375
CIL2020
#include int main( ) { int x=5, y=9; x=(x= x+y)-(y= x-y); printf("%d %d ", x, y); return 0; } A. 9 5 B. 5 14 C. 14 5 D. 5 9
#includeint main( ){int x=5, y=9;x=(x= x+y)-(y= x-y);printf("%d %d ", x, y);return 0;} A. 9 5B. 5 14C. 14 5D. 5 9
vivek_mishra
733
views
vivek_mishra
asked
Mar 5, 2020
Programming in C
cprogramming
programming
output
+
–
1
votes
2
answers
376
TIFR CSE 2020 | Part B | Question: 12
Given the pseudocode below for the function $\textbf{remains()}$, which of the following statements is true about the output, if we pass it a positive integer $n>2$? int remains(int n) { int x = n; for (i=(n-1);i>1;i--) { x = x % i ; } ... $1$ Output is $0$ only if $n$ is NOT a prime number Output is $1$ only if $n$ is a prime number None of the above
Given the pseudocode below for the function $\textbf{remains()}$, which of the following statements is true about the output, if we pass it a positive integer $n>2$?int r...
admin
931
views
admin
asked
Feb 10, 2020
Programming in C
tifr2020
programming
programming-in-c
functions
+
–
6
votes
6
answers
377
ISRO2020-18
Consider a $2$-dimensional array $x$ with $10$ rows and $4$ columns, with each element storing a value equivalent to the product of row number and column number. The array is stored in row-major format. If the first element $x[0][0]$ occupies the memory location ... , which all locations (in decimal) will be holding a value of $10$? $1018,1019$ $1022,1041$ $1013,1014$ $1000,1399$
Consider a $2$-dimensional array $x$ with $10$ rows and $4$ columns, with each element storing a value equivalent to the product of row number and column number. The arra...
Satbir
9.6k
views
Satbir
asked
Jan 13, 2020
Programming in C
isro-2020
programming
array
normal
+
–
6
votes
5
answers
378
ISRO2020-61
What is the output of the code given below? # include<stdio.h> int main() { char name[]="satellites"; int len; int size; len= strlen(name); size = sizeof(name); printf("%d",len*size); return 0; } $100$ $110$ $40$ $44$
What is the output of the code given below?# include<stdio.h int main() { char name[]="satellites"; int len; int size; len= strlen(name); size = sizeof(name); printf("%d"...
Satbir
3.7k
views
Satbir
asked
Jan 13, 2020
Programming in C
isro-2020
programming
array
normal
+
–
2
votes
3
answers
379
ISRO2020-59
Consider the following recursive C function that takes two arguments unsigned int rer(unsigned int n, unsigned int r){ if(n>0)return(n%r + rer(n/r,r)); else retturn 0; } What is the return value of the function $rer$ when it is called as $rer(513,2)$? $9$ $8$ $5$ $2$
Consider the following recursive C function that takes two argumentsunsigned int rer(unsigned int n, unsigned int r){ if(n>0)return(n%r + rer(n/r,r)); else retturn 0; }Wh...
Satbir
1.8k
views
Satbir
asked
Jan 13, 2020
Programming in C
isro-2020
programming
normal
recursion
+
–
6
votes
1
answer
380
ISRO2020-78
In the following procedure Integer procedure P(X,Y); Integer X,Y; value x; begin K=5; L=8; P=x+y; end $X$ is called by value and $Y$ is called by name. If the procedure were invoked by the following program fragment K=0; L=0; Z=P(K,L); then the value of $Z$ will be set equal to $5$ $8$ $13$ $0$
In the following procedureInteger procedure P(X,Y); Integer X,Y; value x; begin K=5; L=8; P=x+y; end$X$ is called by value and $Y$ is called by name. If the procedure wer...
Satbir
3.6k
views
Satbir
asked
Jan 13, 2020
Programming in C
isro-2020
programming
functions
normal
+
–
2
votes
3
answers
381
ISRO2020-74
Following declaration of an array of struct, assumes size of byte, short, int and long are $1,2,3$ and $4$ respectively. Alignment rule stipulates that $n$ - byte field must be located at an address divisible by $n$, the fields in the struct are not rearranged, padding is used ... is located at an address divisble by $8$, what is the total size of $C$, in bytes? $150$ $160$ $200$ $240$
Following declaration of an array of struct, assumes size of byte, short, int and long are $1,2,3$ and $4$ respectively. Alignment rule stipulates that $n$ – byte field...
Satbir
3.3k
views
Satbir
asked
Jan 13, 2020
Programming in C
isro-2020
programming
normal
structure
+
–
10
votes
1
answer
382
ISRO2020-63
What is the output in a $32$ bit machine with $32$ bit compiler? #include<stdio.h> rer(int **ptr2, int **ptr1) { int *ii; ii=*ptr2; *ptr2=*ptr1; *ptr1=ii; **ptr1*=**ptr2; **ptr2+=**ptr1; } void main(){ int var1=5, var2=10; int *ptr1=&var1,*ptr2=&var2; rer(&ptr1,&ptr2); printf("%d %d",var2,var1); } $60,70$ $50,50$ $50,60$ $60,50$
What is the output in a $32$ bit machine with $32$ bit compiler?#include<stdio.h rer(int ptr2, int ptr1) { int *ii; ii=*ptr2; *ptr2=*ptr1; *ptr1=ii; ptr1*= ptr2; ptr2...
srestha
3.9k
views
srestha
asked
Jan 12, 2020
Programming in C
isro-2020
programming
programming-in-c
normal
pointers
+
–
12
votes
2
answers
383
ISRO2020-62
What is output of the following ‘C’ code assuming it runs on a byte addressed little endian machine? #include<stdio.h> int main() { int x; char *ptr; x=622,100,101; printf("%d",(*(char *)&x)*(x%3)); return 0; } $622$ $311$ $22$ $110$
What is output of the following ‘C’ code assuming it runs on a byte addressed little endian machine?#include<stdio.h int main() { int x; char *ptr; x=622,100,101; pri...
srestha
5.6k
views
srestha
asked
Jan 12, 2020
Programming in C
isro-2020
programming
programming-in-c
normal
pointers
+
–
6
votes
1
answer
384
c-programming self doubt
#include<stdio.h> #include<stdlib.h> int main(void) { int maxLineCount = 500, maxCharCount = 500, index, j, count; char *line = NULL; size_t size; char *a[maxLineCount]; for (index = 0; index < maxLineCount; index++) a[index] = ... code is doing. suppose we have 3 string given as input in 3 different lines then how can we access each character of the string?
#include<stdio.h #include<stdlib.h int main(void) { int maxLineCount = 500, maxCharCount = 500, index, j, count; char *line = NULL; size_t size; char *a[maxLineCount]; fo...
Satbir
6.1k
views
Satbir
asked
Jun 1, 2019
Programming in C
programming-in-c
programming
output
+
–
4
votes
3
answers
385
Made Easy Test Series:Programming(FLT4)
#include<stdio.h> #include<iostream> int bar(int m, int n){ if(m==0)return n; if(n==0)return m; return bar(n%m,m); } int foo(int m,int n){ return(m*n/bar(m,n)); } int main(){ int x=foo(1000,1500); printf("%d",x); return 0; } Output of the program is ___________
#include<stdio.h #include<iostream int bar(int m, int n){ if(m==0)return n; if(n==0)return m; return bar(n%m,m); } int foo(int m,int n){ return(m*n/bar(m,n)); } int main(...
srestha
985
views
srestha
asked
May 20, 2019
Programming in C
made-easy-test-series
programming
programming-in-c
+
–
2
votes
1
answer
386
Made Easy Test Series:Programming in C
Consider the following $C$ implementation which when given $3$ numbers a,b,c as input, find the maximum of $3$ numbers $a,b,c.$ int kickstart(int a,int b,int c) { if(B1) return a; if(a>=b) return B2; return kickstart(c,a,b); } How the boxes filled up ... $a\geq c, B2:kickstart\left ( b,c,a \right );$ Is it $I) and II)$ or $I) and IV)$
Consider the following $C$ implementation which when given $3$ numbers a,b,c as input, find the maximum of $3$ numbers $a,b,c.$int kickstart(int a,int b,int c) { if(B1) r...
srestha
990
views
srestha
asked
May 19, 2019
Programming in C
made-easy-test-series
programming
programming-in-c
+
–
2
votes
2
answers
387
Made Easy Test Series:Programming Test
Consider the following function $foo()$ void foo(int n){ if(n<=0) printf("Bye"); else{ printf("Hi"); foo(n-3); printf("Hi"); foo(n-1); } } Let $P(n)$ represent recurrence relation, indicating number of ... $1$ or $2?$
Consider the following function $foo()$void foo(int n){ if(n<=0) printf("Bye"); else{ printf("Hi"); foo(n-3); printf("Hi"); foo(n-1); } }Let $P(n)$ represent recurrence r...
srestha
1.1k
views
srestha
asked
May 12, 2019
Programming in C
made-easy-test-series
programming
programming-in-c
+
–
Page:
« prev
1
...
8
9
10
11
12
13
14
15
16
17
18
...
32
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register