Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage
Programming in C.
Recursion.
Filter
Recent
Hot!
Most votes
Most answers
Most views
Previous GATE
Featured
Most viewed questions in Programming and DS
0
votes
2
answers
1891
C programming
a=4 and b=3 printf("%d",a+++b); output.?? My doubt is that we will read from left as a++ or as ++b.
a=4 and b=3printf("%d",a+++b);output.??My doubt is that we will read from left as a++ or as ++b.
Ravi_1511
1.0k
views
Ravi_1511
asked
Jan 23, 2017
Programming in C
programming-in-c
output
+
–
3
votes
1
answer
1892
Program1
const int perplexed = 2; #define perplexed 3 main() { #ifdef perplexed #undef perplexed #define perplexed 4 #endif printf("%d",perplexed); } a. 0 b. 2 c. 4 d. none of the above
const int perplexed = 2; #define perplexed 3 main() { #ifdef perplexed #undef perplexed #define perplexed 4 #endif printf("%d",perplexed); }a. 0 b. 2 c. 4 d. none of the...
srestha
1.0k
views
srestha
asked
Aug 14, 2016
Programming in C
programming-in-c
+
–
3
votes
1
answer
1893
Output of program
Consider the following code int main(){ char *str = "ABCDEF"; printf("%d",fun(str)); return 0; } int fun(int *p1){ int *p2 = p1; while(*++p1); return (p2-p1); } The output of given program is_________. Assume object of data type int occupies 2 bytes.
Consider the following codeint main(){ char *str = "ABCDEF"; printf("%d",fun(str)); return 0; } int fun(int *p1){ int *p2 = p1; while(*++p1); return (p2-p1); }The output ...
Rohit Gupta 8
1.0k
views
Rohit Gupta 8
asked
Oct 8, 2017
Programming in C
strings
bad-question
+
–
1
votes
1
answer
1894
c programming
Jaspreet Kaur Bains
1.0k
views
Jaspreet Kaur Bains
asked
Jan 7, 2018
Programming in C
programming-in-c
+
–
0
votes
0
answers
1895
segmentation fault or compilation error ?
Consider this C code to swap two integers and these five statements : void swap (int * px, int * py) { * px = *px - *py ; *py = *px + *py; *px = *py - *px; } S1 : Will generate a compilation error S2 : May generate a segmentation fault ... input pointers. S5 : May add or subtract integers and pointers. (A) S1 (B) S2 and S3 (C) S2 and S4 (D) S2 and S5
Consider this C code to swap two integers and these five statements :void swap (int * px, int * py){ * px = *px – *py ; *py = *px + *py; *...
Sanjay Sharma
1.0k
views
Sanjay Sharma
asked
Feb 24, 2017
3
votes
1
answer
1896
Algorithms
I am having a doubt in this question. The binary search algorithm is implemented using recursion. Then the space complexity is :- (1) O( 1 ) (2) O( n ) (3) O( logn ) (4) O(n logn ) According to me, the answer should be option 2. Please explain the solution as well.
I am having a doubt in this question. The binary search algorithm is implemented using recursion. Then the space complexity is :-(1) O( 1 )(2) O( n )(3) O( logn )(4) O(n ...
Asim Abbas
999
views
Asim Abbas
asked
Jan 12, 2018
Programming in C
algorithms
space-complexity
+
–
0
votes
1
answer
1897
Linked list time complexity
I think it should be O(L).
I think it should be O(L).
Xylene
999
views
Xylene
asked
Aug 21, 2017
Programming in C
data-structures
programming-in-c
+
–
3
votes
2
answers
1898
Stack
I am getting a) as ans. Plz tell how C?
I am getting a) as ans. Plz tell how C?
srestha
999
views
srestha
asked
Jan 4, 2017
DS
stack
+
–
0
votes
1
answer
1899
C programming/ predict the output
main() { int c=- -2; printf("c=%d",c); }
main() { int c=- -2; printf("c=%d",c); }
Desert_Warrior
999
views
Desert_Warrior
asked
May 16, 2016
Programming in C
programming-in-c
output
+
–
0
votes
2
answers
1900
Programming Scope of variables
The following program runs perfectly fine without showing compilation error. I am unable to understand why as 'c' is a local variable of 'function_addition'. So, shouldn't it throw an error? #include<stdio.h> int ... ambiguity as to why the first one prints the value of c correctly whereas the second program shows an error.
The following program runs perfectly fine without showing compilation error. I am unable to understand why as 'c' is a local variable of 'function_addition'. So, shouldn'...
Bongbirdie
998
views
Bongbirdie
asked
May 28, 2017
Programming in C
programming-in-c
scoping-rule
variable-scope
+
–
3
votes
2
answers
1901
What is return value of BSR Routine ?
Consider the following function. Assume that the array contains list of all the numbers from 1 to k –1. What is the return value of function BSR? Sum of all numbers Repeated number in the list Average of all the numbers None of these ------------- ... from it which is also (k-1*k) /2 . So it will always return 0. Q 37 Made Easy FLT 6-Practice Test 14
Consider the following function.Assume that the array contains list of all the numbers from 1 to k –1. What is the return value of function BSR?Sum of all numbersRe...
Akash Kanase
998
views
Akash Kanase
asked
Dec 1, 2015
Programming in C
programming
loop
functions
+
–
0
votes
1
answer
1902
Matrix Multiplication
Consider three matrices A (10 × 100), B (100 × 5), C (5 × 50). What is total number of multiplications required? Your Answer: 500 Correct Answer: 7500 Status: incorrect
Consider three matrices A (10 × 100), B (100 × 5), C (5 × 50). What is total number of multiplications required?Your Answer:500Correct Answer: 7500 Status: incorrec...
vishwa ratna
997
views
vishwa ratna
asked
Jan 17, 2017
2
votes
1
answer
1903
Could any one explain me How to derive formula in RMO CMO ?
There has to be a general method in deriving equations based on RMO and CMO . Could any one explain me how to derive formula of RMO and CMO of important matrices like Upper Triangular Lower Triangular S matrice z matrix Diagonal MAtrix etc
There has to be a general method in deriving equations based on RMO and CMO .Could any one explain me how to derive formula of RMO and CMO of important matrices likeUpper...
pC
996
views
pC
asked
Dec 23, 2015
DS
array
+
–
0
votes
0
answers
1904
Depth First Search
Na462
995
views
Na462
asked
Nov 7, 2018
Programming in C
depth-first-search
data-structures
graph-algorithms
+
–
1
votes
1
answer
1905
Programming
n=3; printf("%d %d",n++,++n); 1) 3 5 b) 4 5 c) 4 4 d) implementation dependent
n=3;printf("%d %d",n++,++n);1) 3 5b) 4 5c) 4 4d) implementation dependent
A_i_$_h
995
views
A_i_$_h
asked
Jun 14, 2017
8
votes
2
answers
1906
Data structure
Ttotal number of BST's possible with 6 nodes numbered 1,2,3,4,5 and 6 having a height of 4 are ??
Ttotal number of BST's possible with 6 nodes numbered 1,2,3,4,5 and 6 having a height of 4 are ??
Ravi prakash pandey
994
views
Ravi prakash pandey
asked
Oct 2, 2017
1
votes
1
answer
1907
why output is 300?
#include <stdio.h> int main(void) { int i; char *p=(char *)&i; ++p; (*p)=2; printf("%d",i); return 0; }
#include <stdio.h>int main(void){ int i; char *p=(char *)&i; ++p; (*p)=2; printf("%d",i); return 0;}
firki lama
994
views
firki lama
asked
Jan 9, 2017
Programming in C
programming-in-c
+
–
0
votes
0
answers
1908
3-D array
Consider 3 dimensional Array A[90] [30] [40] stored in linear array in column major order. If the base address starts at 10. The location of A[20] [20] [30] is __________ . [Assume the first element is stored at A[1][1][1] and each element take 1 B]. A(20,30,30)=10 + 30*2700+ 20 + 19 = 81049 ans is 23699 ... where did i go wrong ? Kindly help thanks
Consider 3 dimensional Array A[90] [30] [40] stored in linear array in column major order. If the base address starts at 10. The location of A[20] [20] [30] is __________...
Pawan Kumar 2
993
views
Pawan Kumar 2
asked
Dec 21, 2017
Programming in C
array
multi-dimensional-array
+
–
0
votes
1
answer
1909
Priority queue stack
How to implement Priority queue using stack?What will be time complexity for Enqueue and Dequeue operations? Edit:- Updated the question clearly
How to implement Priority queue using stack?What will be time complexity for Enqueue and Dequeue operations?Edit:- Updated the question clearly
rahul sharma 5
993
views
rahul sharma 5
asked
Dec 17, 2016
Programming in C
data-structures
priority-queue
test-series
+
–
1
votes
1
answer
1910
Hashing
using Method : Fold shift , we can find key then what use of Fold shift in Hashing
using Method : Fold shift , we can find keythen what use of Fold shift in Hashing
Anil Khatri
993
views
Anil Khatri
asked
Sep 28, 2016
DS
data-structures
hashing
+
–
Page:
« prev
1
...
90
91
92
93
94
95
96
97
98
99
100
...
310
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register