Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged programming-in-c
2
votes
1
answer
481
NIELIT 2017 July Scientist B (IT) - Section B: 35
Assume that float takes $4$ bytes, predict the output of following program. #include<stdio.h> int main() { float arr[5]={12.5,10.0,13.5,90.5,0.5}; float *ptr1=&arr[0]; float *ptr2=ptr1+3; printf("%f",*ptr2); printf("%d",ptr2-ptr1); return 0; } $90.500000\:\:3$ $90.500000\:\:12$ $10.000000\:\:12$ $0.500000\:\:3$
Assume that float takes $4$ bytes, predict the output of following program.#include<stdio.h int main() { float arr[5]={12.5,10.0,13.5,90.5,0.5}; float *ptr1=&arr[0]; floa...
admin
2.6k
views
admin
asked
Mar 30, 2020
Programming in C
nielit2017july-scientistb-it
programming-in-c
pointers
array-of-pointers
+
–
4
votes
1
answer
482
NIELIT 2017 July Scientist B (IT) - Section B: 36
Assume that size of an integer is $32$ bit. What is the output of following ANSI C program? #include<stdio.h> struct st { int x; static int y; }; int main() { printf(%d",sizeof(struct st)); return 0; } $4$ $8$ Compiler Error Runtime Error
Assume that size of an integer is $32$ bit. What is the output of following ANSI C program? #include<stdio.h struct st { int x; static int y; }; int main() { printf(%d",s...
admin
2.0k
views
admin
asked
Mar 30, 2020
Programming in C
nielit2017july-scientistb-it
programming-in-c
output
+
–
3
votes
2
answers
483
NIELIT 2017 July Scientist B (IT) - Section B: 38
Output of the following program? #include<stdio.h> struct st { int x; struct st next; }; int main() { struct st temp; temp.x=10; temp.next=temp; printf("%d",temp.next,x); return 0; } Compiler Error $10$ Runtime Error Garbage Value
Output of the following program?#include<stdio.h struct st { int x; struct st next; }; int main() { struct st temp; temp.x=10; temp.next=temp; printf("%d",temp.next,x); r...
admin
1.5k
views
admin
asked
Mar 30, 2020
Programming in C
nielit2017july-scientistb-it
programming-in-c
output
+
–
2
votes
2
answers
484
NIELIT 2017 July Scientist B (CS) - Section B: 5
Following is C like Pseudo code of a function that takes a number as an argument, and uses a stack S to do processing. void fun(int n) { Stack S;//Say it creates an empty stack S while(n>0) { // This line pushes the value of ... . Prints binary representation of $n$. Prints the value of $\log n$. Prints the value of $\log n$ in reverse order.
Following is C like Pseudo code of a function that takes a number as an argument, and uses a stack S to do processing. void fun(int n) { Stack S;//Say it creates an empty...
admin
6.4k
views
admin
asked
Mar 30, 2020
Programming in C
nielit2017july-scientistb-cs
programming-in-c
+
–
2
votes
2
answers
485
NIELIT 2017 DEC Scientist B - Section B: 44
If $x$ is a one dimensional array, then $^*(x+i)$ is same as $^*(\&x[i])$ $\&x[i]$ is same as $x+i-1$ $^*(x+i)$ is same as $^*x[i]$ $^*(x+i)$ is same as $^*x+i$
If $x$ is a one dimensional array, then$^*(x+i)$ is same as $^*(\&x[i])$$\&x[i]$ is same as $x+i-1$$^*(x+i)$ is same as $^*x[i]$$^*(x+i)$ is same as $^*x+i$
admin
1.7k
views
admin
asked
Mar 30, 2020
Programming in C
nielit2017dec-scientistb
programming-in-c
array-of-pointers
+
–
3
votes
4
answers
486
UGC NET CSE | June 2007 | Part 2 | Question: 14
What is the output of the following $\text{’C’}$ program? main() { printf(“%x”,-1>>4); } $\text{ffff}$ $\text{0fff}$ $\text{0000}$ $\text{fff0}$
What is the output of the following $\text{’C’}$ program?main() { printf(“%x”,-1>>4); }$\text{ffff}$$\text{0fff}$$\text{0000}$$\text{fff0}$
go_editor
3.0k
views
go_editor
asked
Mar 28, 2020
Programming and DS
ugcnetcse-june2007-paper2
programming-in-c
+
–
2
votes
6
answers
487
UGC NET CSE | December 2005 | Part 2 | Question: 11
What is the output of the following $C$-program main() { printf("%d %d %d",size of (3.14f), size of (3.14), size of (3.141)); } 4 4 4 4 8 10 8 4 8 8 8 8
What is the output of the following $C$-programmain() { printf("%d %d %d",size of (3.14f), size of (3.14), size of (3.141)); }4 4 44 8 108 4 88 8 8
go_editor
2.1k
views
go_editor
asked
Mar 27, 2020
Programming in C
ugcnetcse-dec2005-paper2
programming-in-c
data-types
+
–
0
votes
2
answers
488
UGC NET CSE | December 2005 | Part 2 | Question: 15
What will be the value of $i$ for the following expression: int f=11, i=3 ; i + = (f>3) ? i & 2:5 ; $2$ $5$ $13$ $12$
What will be the value of $i$ for the following expression:int f=11, i=3 ; i + = (f>3) ? i & 2:5 ;$2$$5$$13$$12$
go_editor
1.4k
views
go_editor
asked
Mar 27, 2020
Programming in C
ugcnetcse-dec2005-paper2
programming-in-c
operators
+
–
1
votes
2
answers
489
UGC NET CSE | June 2005 | Part 2 | Question: 11
After $3$ calls of the $c$ function bug ( ) below, the values of $i$ and $j$ will be : int j = 1; bug () { static int i = 0; int j = 0; i++; j++; return (i); } $i = 0, j = 0$ $i = 3, j = 3$ $i = 3, j = 0$ $i = 3, j = 1$
After $3$ calls of the $c$ function bug ( ) below, the values of $i$ and $j$ will be :int j = 1; bug () { static int i = 0; int j = 0; i++; j++; return (i); }$i = 0, j = ...
go_editor
1.5k
views
go_editor
asked
Mar 26, 2020
Programming in C
ugcnetcse-june2005-paper2
programming-in-c
variable-scope
+
–
1
votes
8
answers
490
UGC NET CSE | June 2005 | Part 2 | Question: 12
Find the output of the following $“C”$ code : Main() { int x=20, y=35; x=y++ + x++; y=++y + ++x; printf (“%d, %d\n”, x, y); } $55, 93$ $53, 97$ $56, 95$ $57, 94$
Find the output of the following $“C”$ code :Main() { int x=20, y=35; x=y++ + x++; y=++y + ++x; printf (“%d, %d\n”, x, y); }$55, 93$$53, 97$$56, 95$$57, 94$
go_editor
2.2k
views
go_editor
asked
Mar 26, 2020
Programming in C
ugcnetcse-june2005-paper2
programming-in-c
variable-scope
+
–
3
votes
2
answers
491
UGC NET CSE | June 2005 | Part 2 | Question: 15
Main() { char *str="abcde"; printf("%c",*str); printf("%c",*str++); printf("%c",*(str++)); printf("%s",str); } The output of the above $‘C’$ code will be : $\text{a a c b c d e}$ $\text{a a c c c d e}$ $\text{a a b c d e}$ None of these
Main() { char *str="abcde"; printf("%c",*str); printf("%c",*str++); printf("%c",*(str++)); printf("%s",str); }The output of the above $‘C’$ code will be :$\text{a a c...
go_editor
1.1k
views
go_editor
asked
Mar 26, 2020
Programming in C
ugcnetcse-june2005-paper2
programming-in-c
variable-scope
+
–
0
votes
2
answers
492
UGC NET CSE | December 2004 | Part 2 | Question: 11
Suppose $x$ and $y$ are two Integer Variables having values $0\text{x5AB6}$ and $0\text{x61CD}$ respectively. The result (in hex) of applying bitwise operator and to $x$ and $y$ will be : $0\text{x5089}$ $0\text{x4084}$ $0\text{x78A4}$ $0\text{x3AD1}$
Suppose $x$ and $y$ are two Integer Variables having values $0\text{x5AB6}$ and $0\text{x61CD}$ respectively. The result (in hex) of applying bitwise operator and to $x$ ...
go_editor
903
views
go_editor
asked
Mar 26, 2020
Programming in C
ugcnetcse-dec2004-paper2
programming-in-c
bitwise-operation
+
–
1
votes
5
answers
493
UGC NET CSE | December 2004 | Part 2 | Question: 13
What is the value of the arithmetic expression (Written in C) $2*3/4-3/4*2$ $0$ $1$ $1.5$ None of these
What is the value of the arithmetic expression (Written in C)$2*3/4-3/4*2$$0$$1$$1.5$None of these
go_editor
1.4k
views
go_editor
asked
Mar 26, 2020
Programming in C
ugcnetcse-dec2004-paper2
programming-in-c
expression-evaluation
operator-precedence
+
–
0
votes
2
answers
494
UGC NET CSE | January 2017 | Part 2 | Question: 13
Which of the following storage classes have global visibility in $C/C++$? Auto Extern Static Register
Which of the following storage classes have global visibility in $C/C++$?AutoExternStaticRegister
go_editor
864
views
go_editor
asked
Mar 24, 2020
Programming and DS
ugcnetjan2017ii
programming-in-c
storage-classes-in-c
+
–
36
votes
2
answers
495
GATE CSE 2020 | Question: 22
Consider the following C program. #include <stdio.h> int main () { int a[4] [5] = {{1, 2, 3, 4, 5}, {6, 7,8, 9, 10}, {11, 12, 13, 14, 15}, {16, 17,18, 19, 20}}; printf(“%d\n”, *(*(a+**a+2)+3)); return(0); } The output of the program is _______.
Consider the following C program.#include <stdio.h int main () { int a[4] [5] = {{1, 2, 3, 4, 5}, {6, 7,8, 9, 10}, {11, 12, 13, ...
Arjun
23.2k
views
Arjun
asked
Feb 12, 2020
Programming in C
gatecse-2020
numerical-answers
programming-in-c
array
1-mark
+
–
38
votes
3
answers
496
GATE CSE 2020 | Question: 46
Consider the following C functions. int fun1(int n) { static int i= 0; if (n > 0) { ++i; fun1(n-1); } return (i); } int fun2(int n) { static int i= 0; if (n>0) { i = i+ fun1 (n) ; fun2(n-1) ; } return (i); } The return value of $\text{fun}2 (5)$ is _________
Consider the following C functions.int fun1(int n) { static int i= 0; if (n 0) { ++i; fun1(n-1); } return (i); }int fun2(int n) { static int i= ...
Arjun
23.2k
views
Arjun
asked
Feb 12, 2020
Programming in C
gatecse-2020
numerical-answers
programming-in-c
recursion
2-marks
+
–
1
votes
2
answers
497
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
+
–
10
votes
1
answer
498
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
499
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
+
–
5
votes
3
answers
500
UGC NET CSE | June 2019 | Part 2 | Question: 22
Consider the following C-code fragment running on a $32$-bit $X86$ machine: typedef struct { union { unsigned char a; unsigned short b; } U; unsigned char c; }S; S B[10]; S*p=&B[4]; S*q=&B[5]; p → U.b=0x1234; /* structure S takes 32-bits */ If M is the ... $(M,N)$ is $(1,1)$ $(3,2)$ $(1,2)$ $(4,4)$
Consider the following C-code fragment running on a $32$-bit $X86$ machine:typedef struct { union { unsigned char a; unsigned short b; } U; unsigned char c; }S; S B[10...
Arjun
2.8k
views
Arjun
asked
Jul 2, 2019
Programming in C
ugcnetcse-june2019-paper2
programming-in-c
+
–
1
votes
1
answer
501
UGC NET CSE | June 2019 | Part 2 | Question: 24
Consider the following C++ function f(): unsigned int f(unsigned int n) { unsigned int b=0; while (n) { b+=n & 1; n>>1; } return b; } The function f() returns the int that represents the ____P____ in the binary representation of positive integer n, where P is number of $0$’s number of bits number of consecutive $1$’s number of $1$’s
Consider the following C++ function f():unsigned int f(unsigned int n) { unsigned int b=0; while (n) { b+=n & 1; n>>1; } return b; }The function f() returns the int that ...
Arjun
2.3k
views
Arjun
asked
Jul 2, 2019
Object Oriented Programming
ugcnetcse-june2019-paper2
programming-in-c
+
–
1
votes
2
answers
502
How Self-Referential Structure works?
I have learnt that self-referential structure is one which contains a structure of same type in it as an element. But I have a doubt regarding how that line is compiled successfully (i.e, how compiler knows how much space should be allocated and ... not yet finished? struct node { int data; struct node *next; }; correct me If I am wrong in understanding this.
I have learnt that self-referential structure is one which contains a structure of same type in it as an element. But I have a doubt regarding how that line is compiled s...
Sathuri Bharath
1.2k
views
Sathuri Bharath
asked
Jun 12, 2019
Programming in C
programming-in-c
pointers
+
–
1
votes
0
answers
503
Precision Field in printf with %s specifier
We know that UNIX support a feature that allows for variable field with precision. please help me out in this statement -> printf(“% * .* s \n”,w,d,string); ? i know using of precision with string such as %10.4s <width>.<precision> indicating that first four character to be printed in a field with 10 columns.
We know that UNIX support a feature that allows for variable field with precision.please help me out in this statement ->printf(“% * .* s \n”,w,d,string); ?i know us...
Aks9639
356
views
Aks9639
asked
Jun 6, 2019
Programming in C
programming-in-c
+
–
0
votes
1
answer
504
Self Doubt:Infinite loop
#include<iostream> using namespace std; int i=0; void a() { i+=1; cout<<i<< ".hello"<<endl; a(); } int main() { a(); } For this above code the output is only upto → 64891.Hello Does this mean that that the stack can hold only 64891 recursive calls? (I am using dev c++)
#include<iostream using namespace std; int i=0; void a() { i+=1; cout<<i<< ".hello"<<endl; a(); } int main() { a(); }For this above code the output is only upto → 6489...
Hirak
1.2k
views
Hirak
asked
Jun 2, 2019
Programming in C
algorithms
programming-in-c
recursion
+
–
6
votes
1
answer
505
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
4
answers
506
C Program Output and Explaination
void fun(int *p) { int q = 10; p = &q; z } int main() { int r = 20; int *p = &r; fun(p); printf("%d", *p); return 0; }
void fun(int *p) { int q = 10; p = &q; z } int main() { int r = 20; int *p = &r; fun(p); printf("%d", *p); return 0; }
manisha11
1.5k
views
manisha11
asked
May 30, 2019
Programming in C
programming-in-c
+
–
4
votes
4
answers
507
Pointers address
https://gateoverflow.in/?qa=blob&qa_blobid=14433986388826671915 int main() { int a = 10; int *b = &a; scanf("%d",b); printf("%d",a+50); } What will be the Output of the following code if input given is $25$ ?
https://gateoverflow.in/?qa=blob&qa_blobid=14433986388826671915int main() { int a = 10; int *b = &a; scanf("%d",b); printf("%d",a+50); }What will be the Output of the fol...
Manoj Kumar Pandey
797
views
Manoj Kumar Pandey
asked
May 22, 2019
Programming in C
programming-in-c
pointers
+
–
4
votes
3
answers
508
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
509
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
992
views
srestha
asked
May 19, 2019
Programming in C
made-easy-test-series
programming
programming-in-c
+
–
1
votes
1
answer
510
Self doubt Data structures
Implement Linked list using stack.
Implement Linked list using stack.
shraddha priya
1.0k
views
shraddha priya
asked
May 19, 2019
Programming in C
programming-in-c
+
–
Page:
« prev
1
...
12
13
14
15
16
17
18
19
20
21
22
...
64
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register