Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged programming-in-c
1
votes
2
answers
1291
C Programming
nitish
1.3k
views
nitish
asked
Jun 1, 2017
Programming in C
programming-in-c
output
+
–
0
votes
4
answers
1292
programming Strings
For the following program: #include<stdio.h> char *getString() { char *str = "GfG"; return str; } int main() {getString(); printf("%s", str); // Gives error, but printf("%s", getString()); works perfect. return ... does not get destroyed, wh can't we print the value using str? Why does the program give error saying that str is undeclared?
For the following program:#include<stdio.h>char *getString(){char *str = "GfG";return str; }int main(){getString();printf("%s", str); // Gives error, but printf("%s", get...
Bongbirdie
1.5k
views
Bongbirdie
asked
May 29, 2017
Programming in C
programming-in-c
strings
variable-scope
+
–
0
votes
2
answers
1293
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
+
–
0
votes
2
answers
1294
oop c++
What is meant by precedence rule for evaluation of expressions?
What is meant by precedence rule for evaluation of expressions?
iarnav
484
views
iarnav
asked
May 27, 2017
Programming in C
programming-in-c
+
–
0
votes
1
answer
1295
oop c++
What are structured languages and what are their major features?
What are structured languages and what are their major features?
iarnav
244
views
iarnav
asked
May 27, 2017
Programming in C
programming-in-c
+
–
0
votes
1
answer
1296
oop c++
Consider a pointer declaration int i=10,*p; p=&x; Is p – – ; a valid statement, justify? explain in as simple way as possible.
Consider a pointer declaration int i=10,*p; p=&x;Is p – – ; a valid statement, justify? explain in as simple way as possible.
iarnav
270
views
iarnav
asked
May 27, 2017
Programming in C
programming-in-c
+
–
0
votes
1
answer
1297
oop c++
What is the main difference between array of pointers and pointer to an array? please Explain with the help of a program/example
What is the main difference between array of pointers and pointer to an array? please Explain with the help of a program/example
iarnav
243
views
iarnav
asked
May 27, 2017
Programming in C
programming-in-c
+
–
0
votes
0
answers
1298
oop c++
how to Write a program to search a key string in a array of strings,if a key string is found then return its position and then replace that key string by any string using pointers.
how to Write a program to search a key string in a array of strings,if a key string is found then return its position and then replace that key string by any string using...
iarnav
177
views
iarnav
asked
May 27, 2017
Programming in C
programming-in-c
programming-in-c
+
–
0
votes
1
answer
1299
oop c++
What is the difference between static and dynamic memory allocation ?
What is the difference between static and dynamic memory allocation ?
iarnav
170
views
iarnav
asked
May 27, 2017
Programming in C
programming-in-c
programming-in-c
+
–
0
votes
1
answer
1300
oop c++
. How are stream operators overloaded in cpp?
. How are stream operators overloaded in cpp?
iarnav
143
views
iarnav
asked
May 27, 2017
Programming in C
programming-in-c
+
–
0
votes
1
answer
1301
oop c++
What are the advantages of scope resolutor & referencing in c++?
What are the advantages of scope resolutor & referencing in c++?
iarnav
287
views
iarnav
asked
May 27, 2017
Programming in C
programming-in-c
+
–
0
votes
1
answer
1302
oop c++
At what time are overloaded methods (as opposed to overridden) resolved?
At what time are overloaded methods (as opposed to overridden) resolved?
iarnav
168
views
iarnav
asked
May 27, 2017
Programming in C
programming-in-c
+
–
0
votes
0
answers
1303
Programming Assignment
Write a bubble sort code which should work for any array size up to the memory limit. The program should print the output using a different function, and also must print the number of swaps which took place. Run the code for input sizes, 500, 50000 and ... ---- why rand() should be used in average and worst cases? If without rand() we implement it ,what will be disadvantage
Write a bubble sort code which should work for any array size up to the memory limit. The program should print the output using a different function, and also must print ...
srestha
830
views
srestha
asked
May 25, 2017
Programming in C
programming-in-c
+
–
0
votes
1
answer
1304
The C Programming Language .Dennis Ritchie( Character pointers and functions)
/*strcpy"copy t to s; */ void strcpy(char *s, char *t) { while((*s++=*t++) !='\0'); } Can anyone explain how *s++ or *t++ is being executed. As * and ++ are ... take *s++ is the increment operator being executed first or the dereferencing operator?. Can anyone show the steps of executing this function.
/*strcpy"copy t to s; */void strcpy(char *s, char *t){while((*s++=*t++) !='\0');} Can anyone explain how *s++ or *t++ is being executed. As * and ++ are unary operators h...
Manu FG
1.3k
views
Manu FG
asked
May 21, 2017
Programming in C
programming-in-c
pointers
+
–
1
votes
1
answer
1305
What trees to study in Data structure
Hello may someone tell me what trees need to be studied in Data Structures subject.
Hello may someone tell me what trees need to be studied in Data Structures subject.
iarnav
589
views
iarnav
asked
May 21, 2017
DS
programming-in-c
data-structures
+
–
0
votes
2
answers
1306
Pop() function of stack
Let's say stack is implemented as Link List, then what will pop() function will return to the calling function? The popped element or the what, because while popping at the end we are freeing up the space in which TOS element is present whic needs to be popped!
Let's say stack is implemented as Link List, then what will pop() function will return to the calling function? The popped element or the what, because while popping at t...
iarnav
712
views
iarnav
asked
May 17, 2017
Programming in C
stack
data-structures
programming-in-c
+
–
2
votes
1
answer
1307
#PROG
Predict the output of following program. Assume that the numbers are stored in 2's complement form. #include<stdio.h> int main() { unsigned int x = -1; int y = ~0; if (x == y) printf("same"); else printf("not same"); return 0; } 1.SAME 2.NOT SAME
Predict the output of following program. Assume that the numbers are stored in 2's complement form.#include<stdio.h>int main(){ unsigned int x = -1; int y = ~0; if...
Shashank Kumar Mishr
1.3k
views
Shashank Kumar Mishr
asked
May 17, 2017
Programming in C
programming-in-c
+
–
0
votes
2
answers
1308
Do while
What is the out put of the following code, i think it should be infinite loop, Correct me if iam wrong. When i execute it, only it is printing "Hello" only one Time. #include<stdio.h> int main() { int i = 1; do { printf("Hello\n"); continue; i--; }while(i>=1); return 0; }
What is the out put of the following code,i think it should be infinite loop, Correct me if iam wrong.When i execute it, only it is printing "Hello" only one Time. #inclu...
AnilGoudar
483
views
AnilGoudar
asked
May 14, 2017
Programming in C
general
programming-in-c
+
–
0
votes
0
answers
1309
Test by Bikram | Programming | Test 2 | Question: 6
Which among following statements is/are TRUE? & is bit-wise and && is a logical operator & returns an integer value whereas && returns a boolean value Both the above options are correct Both (A) and (B) are incorrect
Which among following statements is/are TRUE?& is bit-wise and && is a logical operator& returns an integer value whereas && returns a boolean valueBoth the above options...
Bikram
392
views
Bikram
asked
May 14, 2017
Programming in C
tbb-programming-2
binary-operation
programming-in-c
+
–
2
votes
1
answer
1310
Test by Bikram | Programming | Test 2 | Question: 2
Which of the following statements is/are true ? #include <stdio.h> int main() { int x=10, y=200%90, i; for( i=1;i++<=10;); if(x==y); printf("x=%dy=%d\n",x,y ); return 0; } printf() is called infinite times program will produce output x=10,y=20; The program will not produce any output The program will produce some error
Which of the following statements is/are true ?#include <stdio.h int main() { int x=10, y=200%90, i; for( i=1;i++<=10;); if(x==y); printf("x=%dy=%d\n",x,y ); return 0; }p...
Bikram
505
views
Bikram
asked
May 14, 2017
Programming in C
tbb-programming-2
programming-in-c
+
–
0
votes
1
answer
1311
Regarding EOF in C
I have read that in Linux, user can do CTRL+D and it's leads to equivalent, but I have an question that user has to press CTRL+D or write CTRL+D in program like a character.
I have read that in Linux, user can do CTRL+D and it's leads to equivalent, but I have an question that user has to press CTRL+D or write CTRL+D in program like a charact...
iarnav
307
views
iarnav
asked
May 14, 2017
Programming in C
programming-in-c
+
–
0
votes
1
answer
1312
Test by Bikram | Mock GATE | Test 4 | Question: 45
Consider the following code snippet: #include <stdio.h> void s1(int*, int); void s2(int*, int); void (*k[2])(int*, int); int main() { int a = 4; int b = 2; k[0] = s1; k[1] = s2; k[0](&a, b); printf("%d %d ", a, ... void s2(int *k, int q) { int tmp = *k; *k = q; q = tmp; } The output of the above program is : 4242 2222 4444 2424
Consider the following code snippet:#include <stdio.h void s1(int*, int); void s2(int*, int); void (*k )(int*, int); int main() { int a = 4; int b = 2; k[0] = s1; k = s2...
Bikram
413
views
Bikram
asked
May 14, 2017
Programming in C
tbb-mockgate-4
programming
programming-in-c
array-of-pointers
+
–
5
votes
1
answer
1313
Test by Bikram | Mock GATE | Test 4 | Question: 40
Consider the below program : #include <stdio.h> void fun (int[0][3]); int main(void) { int k[3][3]= {{1,2,3}, {4,5,6},{7,8,9}}; fun(k); printf("%d\n", k[2][1]); return 0; } void fun(int p[][3]) { ++p; p[1][1] = 9; } The output of the above program is : ______.
Consider the below program : #include <stdio.h void fun (int[0][3]); int main(void) { int k[3][3]= {{1,2,3}, {4,5,6},{7,8,9}}; fun(k); printf("%d\n", k ); return 0; } vo...
Bikram
400
views
Bikram
asked
May 14, 2017
Programming in C
tbb-mockgate-4
numerical-answers
programming-in-c
array
+
–
1
votes
1
answer
1314
Test by Bikram | Mock GATE | Test 4 | Question: 18
Consider the below code snippet: #include<stdio.h> int main() { int p[15][20][29] = {0}; p[4][2][3] = 6; --------------- return 0; } Which of the following options will print $6$ when added in the missing part of the above code? printf(" ... **((p+4)+2)+3); printf("%d",*(*((p+4)+2)+3)); printf("%d",*(((p+4)+2)+3));
Consider the below code snippet:#include<stdio.h int main() { int p[15][20][29] = {0}; p[4] [3] = 6; - return 0; }Which of the following options will print $6$ when ad...
Bikram
305
views
Bikram
asked
May 14, 2017
GATE
tbb-mockgate-4
programming
programming-in-c
+
–
3
votes
1
answer
1315
Test by Bikram | Mock GATE | Test 4 | Question: 6
Consider the below $C$ code: #include<stdio.h> int main() { char a[] = "gateoverflow"; char *p = a; printf("%s", p+p[3]-p[1]); } The output will be : gate eoverflow overflow Garbage error
Consider the below $C$ code:#include<stdio.h int main() { char a[] = "gateoverflow"; char *p = a; printf("%s", p+p[3]-p ); }The output will be : gate eoverflow overflo...
Bikram
266
views
Bikram
asked
May 14, 2017
Programming in C
tbb-mockgate-4
programming
programming-in-c
+
–
0
votes
1
answer
1316
What happens to global variable(s) when main() is retuned or over?
Folks, as the global or static variables are stored in data section of process and their scope is throughout the program, but once the main() function returns or complete execution or when whole program is executed ... stays or the whole process is deleted including global variables from memory once the program ran to completion?
Folks, as the global or static variables are stored in data section of process and their scope is throughout the program, but once the main() function returns or complete...
iarnav
1.3k
views
iarnav
asked
May 10, 2017
Programming in C
programming-in-c
storage-classes-in-c
+
–
1
votes
1
answer
1317
ISI 2016 PCB C5
What will be the output of the following C program? If you think it will give a runtime error, you need to mention it. In either case, your answer must include proper justifications without which no credit will be given. #include<stdio.h> main() { unsigned char i, j, a[] = {1, 2, 3, 4, 5} ... j, n); while(j-- != 0) a[0] += n; printf("j = %d, a[0] = %d\n", j, a[0]); }
What will be the output of the following C program? If you think it will give a runtime error, you need to mention it. In either case, your answer must include proper jus...
neha.i
458
views
neha.i
asked
May 9, 2017
Others
programming-in-c
output
+
–
2
votes
4
answers
1318
How space will be stored in 1-D array
char * a[] = "red shoes"; How the space in string constant "red shoes" will be stored in 1-D array in memory?
char * a[] = "red shoes";How the space in string constant "red shoes" will be stored in 1-D array in memory?
iarnav
2.5k
views
iarnav
asked
May 8, 2017
Programming in C
array
data-structures
programming-in-c
+
–
5
votes
3
answers
1319
ISRO2017-70
We use malloc and calloc for: Dynamic memory allocation Static memory allocation Both dynamic memory allocation and static memory allocation None of these
We use malloc and calloc for:Dynamic memory allocationStatic memory allocationBoth dynamic memory allocation and static memory allocationNone of these
sh!va
7.2k
views
sh!va
asked
May 7, 2017
Programming in C
isro2017
programming-in-c
runtime-environment
+
–
8
votes
4
answers
1320
ISRO2017-64
What is the output of the following program? #include<stdio.h> int tmp=20; main() { printf("%d", tmp); func(); printf("%d", tmp); } func() { static int tmp=10; printf("%d", tmp); } 20 10 10 20 10 20 20 20 20 10 10 10
What is the output of the following program?#include<stdio.h int tmp=20; main() { printf("%d", tmp); func(); printf("%d", tmp); } func() { static int tmp=10; printf("%d",...
sh!va
5.5k
views
sh!va
asked
May 7, 2017
Programming in C
isro2017
programming-in-c
functions
output
+
–
Page:
« prev
1
...
39
40
41
42
43
44
45
46
47
48
49
...
64
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register