Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged programming-in-c
0
votes
3
answers
1111
Programming
Consider the following program segment int main() { char *str = "GATECS"; printf("%d", madeeasy(str)); return 0; } int madeeasy(int *p1) { int *p2 = p1; while(*++p1); return p1-p2; } The out of above program will be ________. Assume that the object of data type int occupies 2 bytes.
Consider the following program segmentint main(){char *str = "GATECS";printf("%d", madeeasy(str));return 0;}int madeeasy(int *p1){int *p2 = p1;while(*++p1);return p1-p2;}...
Aibi
1.1k
views
Aibi
asked
Oct 30, 2017
Programming in C
programming
programming-in-c
made-easy-test-series
pointers
output
bad-question
+
–
1
votes
1
answer
1112
pointers
int main() { int i,j; char a[2][3]={{'a','b','c'},{'d','e','f'}}; char b[3][2]; char *p=*b; for(i=0;i<2;i++) { for(j=0;j<3;j++) { *(p+2*j+i)=a[i][j]; } } } please explain this...
int main() { int i,j; char a [3]={{'a','b','c'},{'d','e','f'}}; char b[3] ; char *p=*b; for(i=0;i<2;i++) { for(j=0;j<3;j++) { *(p+2*j+i)=a[i][j]; } } }please explain this...
saipriyab
465
views
saipriyab
asked
Oct 26, 2017
Programming in C
programming-in-c
+
–
2
votes
1
answer
1113
Linked List
Which of the following operations is performed more efficiently by doubly linked list than by linear linked list? (a). Deleting a node whose location is given. (b). Searching an unsorted list of a given item. (c). inserting a node after the node with a given location. (d). Traversing the list to process each node.
Which of the following operations is performed more efficiently by doubly linked list than by linear linked list?(a). Deleting a node whose location is given.(b). Searchi...
Shubham Kumar Gupta
3.1k
views
Shubham Kumar Gupta
asked
Oct 26, 2017
Programming in C
linked-list
data-structures
programming-in-c
queue
+
–
2
votes
0
answers
1114
Programming
Can anybody explain these two statements with some example? I am unable to get the difference between them 1) An array, each element of which is a pointer to a structure of type node B) A structure of 2 fields, each field being a pointer to an array of 10 elements Need a clear explaination
Can anybody explain these two statements with some example? I am unable to get the difference between them1) An array, each element of which is a pointer to a structure o...
srestha
539
views
srestha
asked
Oct 26, 2017
Programming in C
programming-in-c
programming
+
–
1
votes
2
answers
1115
C. interesting scenario.
Can you see why the output of the following code is 256? main () { int a=0x1ff; char *careful= &a; *careful = 0; printf("%d", a); }
Can you see why the output of the following code is 256?main () { int a=0x1ff; char *careful= &a; *careful = 0; printf("%d", a); }
AskHerOut
519
views
AskHerOut
asked
Oct 24, 2017
Programming in C
programming
programming-in-c
output
+
–
1
votes
0
answers
1116
C doubt
void function ( char *a , char *b) { ++*a; *b++; } main () { int a=5, b=5; function (&a, &b); printf ("%d,%d",a,b); } Here a and b both are printing the value after execution of function code totally. Then ... that. Is preincrement and postincrement evaluate on line of printing? Why it is not print after increment of a and b both? Plz give brief description about this
void function ( char *a , char *b) { ++*a; *b++; } main () { int a=5, b=5; function (&a, &b); printf ("%d,%d",a,b); }Here a and b both are printing the value after execut...
srestha
713
views
srestha
asked
Oct 24, 2017
Programming in C
programming-in-c
+
–
2
votes
0
answers
1117
C doubt
Inside a program loop if we write *ch1++ it will give "lvalue required" error but without any loop if we write even ++*ch1++; it will not give any lvalue error. Why?
Inside a program loopif we write*ch1++it will give "lvalue required" errorbut without any loop if we write even++*ch1++;it will not give any lvalue error. Why?
srestha
693
views
srestha
asked
Oct 24, 2017
Programming in C
programming-in-c
+
–
1
votes
1
answer
1118
Geeksforgeeks
What will be the output of following programs and why ? 1) void foo(float *); int main() { int i = 10, *p = &i; foo((float*)&i); return 0; } void foo(float *p) { printf("%f\n", *p); } 2) int main() { char arr[] = "geeksforgeeks"; char ... ;<= 2, c >>= 2); getchar(); } Output:4 4 4 I am not getting why the 3rd one is 4,because 5>>2 will give 1
What will be the output of following programs and why ?1)void foo(float *);int main(){int i = 10, *p = &i;foo((float*)&i);return 0;}void foo(float *p){printf("%f\n", *p);...
Amrata Ramchandani 1
1.2k
views
Amrata Ramchandani 1
asked
Oct 24, 2017
Programming in C
programming-in-c
programming-in-c
+
–
0
votes
1
answer
1119
[Programming] What is the output of the following programme ?
#include <stdio.h> int main() { int a[] = {50, 60, 10, 30, 40, 20 }; int *b[] = {a+3, a+4, a, a+2, a+1, a+5 }; int **c = b; c++; printf("%u, %u, %u\n", c-b, *c - a, **c); return 0; }
#include <stdio.h>int main(){ int a[] = {50, 60, 10, 30, 40, 20 }; int *b[] = {a+3, a+4, a, a+2, a+1, a+5 }; int c = b; c++; printf("%u, %u, %u\n", c-b, *...
stblue
783
views
stblue
asked
Oct 18, 2017
Programming in C
programming-in-c
output
pointers
array
+
–
1
votes
2
answers
1120
C Programming
What will be output of below program #include<stdio.h> int tech(int,int); int main(void){ int a=tech(15,4); printf("%d",a); return 0; } int tech(int p,int q){ if(p%q==0) return q; else tech(q,p%q); }
What will be output of below program#include<stdio.h int tech(int,int); int main(void){ int a=tech(15,4); printf("%d",a); return 0; } int tech(int p,int q){ if(p%q==0) re...
srestha
915
views
srestha
asked
Oct 17, 2017
Programming in C
programming-in-c
+
–
1
votes
1
answer
1121
4.Programming
int main() { char ch=1; while(ch<256) ch++; printf("loop end"); return 0; } My doubt here is , will it give undefined behaviour? As we are storing integer value inside character variable and also is incrementation of character pointer will give some error?
int main() { char ch=1; while(ch<256) ch++; printf("loop end"); return 0; }My doubt here is , will it give undefined behaviour? As we are storing integer value inside cha...
srestha
446
views
srestha
asked
Oct 17, 2017
Programming in C
programming-in-c
programming
+
–
2
votes
2
answers
1122
1.Programming
int main() { char str[10]="GATE2018"; int length=strlen(str); str[length]='\0'; for(i=0;str[i];i++) printf("%c",str[i]); return 0; } Find the output?
int main() { char str[10]="GATE2018"; int length=strlen(str); str[length]='\0'; for(i=0;str[i];i++) printf("%c",str[i]); return 0; }Find the output?
srestha
456
views
srestha
asked
Oct 17, 2017
Programming in C
programming-in-c
programming
+
–
4
votes
1
answer
1123
GATEFORUM
for(i=0;i<=n;i++){ for(j=0;j<=i2;j++){ for(k=0;k<=$\frac{n}{2}$;k++){ x=y+z; }}} How many times the x=y+z statement will execute?
for(i=0;i<=n;i++){ for(j=0;j<=i2;j++){ for(k=0;k<=$\frac{n}{2}$;k++){ x=y+z;}}}How many times the x=y+z statement will execute?
Abhi Girin
1.1k
views
Abhi Girin
asked
Oct 16, 2017
Programming in C
programming-in-c
time-complexity
for
loop
asymptotic-notation
normal
+
–
1
votes
2
answers
1124
C (output of code)
int main() { int i=-1, j=-1,k=0,l=2,m; m= i++ && j++ && k++ || l++ ; printf("%d %d %d %d %d", i,j,k,l,m); return 0; }
int main() { int i=-1, j=-1,k=0,l=2,m; m= i++ && j++ && k++ || l++ ; printf("%d %d %d %d %d", i,j,k,l,m); return 0; }
Ashwani Kumar 2
813
views
Ashwani Kumar 2
asked
Oct 16, 2017
Programming in C
programming-in-c
short-circuit-rule
+
–
1
votes
1
answer
1125
Solution of Hackerrank problem
Below 2 codes are given, the code is printing the total number of matching pairs in a given array. Example: if n=9; & the array values are: 10 20 20 10 10 30 50 10 20 Output: 3 Explanation: (10,10) (20,20) (10,10) total 3 matching pairs. There is a ... if(sock[i] == sock[i+1]) pairs++, i++; cout << pairs << endl; return 0; } Explain the difference...
Below 2 codes are given, the code is printing the total number of matching pairs in a given array.Example:if n=9;& the array values are: 10 20 20 10 10 30 50 10 20Output:...
Naveen Kumar 3
888
views
Naveen Kumar 3
asked
Oct 16, 2017
Programming in C
algorithms
programming-in-c
+
–
4
votes
0
answers
1126
Precedence and Associativity of Logical AND and OR
Consider the following Program:- #include <stdio.h> int main() { short a = 1, b = 1, c = 1, d; d = ((a++ || b++ && c++) || 1); printf("a= %d, b = %d, c= %d, d= %d", a,b,c,d) ... 1; Even though the precedence of AND is greater than that of OR, which means && should be executed before ||, but it is not happening. Why??
Consider the following Program:-#include <stdio.h int main() { short a = 1, b = 1, c = 1, d; d = ((a++ || b++ && c++) || 1); printf("a= %d, b = %d, c= %d, d= %d", a,b,c,d...
Shubhanshu
806
views
Shubhanshu
asked
Oct 15, 2017
Programming in C
programming-in-c
+
–
0
votes
2
answers
1127
Programming
rec(int x) { static int f; if(x==1) return 1; else f+=x*rec(x-1); return(f); } the value returned by rec(5) is_____________
rec(int x) { static int f; if(x==1) return 1; else f+=x*rec(x-1); return(f); }the value returned by rec(5) is_____________
srestha
709
views
srestha
asked
Oct 13, 2017
Programming in C
programming-in-c
+
–
2
votes
1
answer
1128
Find Output
What is the output of the following program? int main ( ) { char *str = “Gate2018” printf (“%d”, output (str)) ; return 0; } int output(char *P1) { char *P2 = P1 ; while (*++P1) ; return (P1 – P2); }
What is the output of the following program?int main ( ){char *str = “Gate2018”printf (“%d”, output (str)) ;return 0;}int output(char *P1){char *P2 = P1 ;while (*...
Shivi rao
543
views
Shivi rao
asked
Oct 11, 2017
Programming in C
data-structures
programming-in-c
+
–
1
votes
1
answer
1129
computer programing book arihant
i=0; j=--i ; printf( i++ + --i + i-- + j-- + --i + i); the output??
i=0;j= i ;printf( i++ + i + i + j + i + i);the output??
aaru14
253
views
aaru14
asked
Oct 11, 2017
Programming in C
programming-in-c
+
–
3
votes
1
answer
1130
output type question
Ans given is D.I want to know the logic behind
Ans given is D.I want to know the logic behind
indrajeet
558
views
indrajeet
asked
Oct 8, 2017
Programming in C
programming-in-c
output
+
–
0
votes
3
answers
1131
C programming
#include<stdio.h> int main() { int a=10,b=20,c=30; c==a==b; Printf("%d%d%d",a,b,c); return0;}
#include<stdio.h>int main(){ int a=10,b=20,c=30;c==a==b;Printf("%d%d%d",a,b,c);return0;}
S .shubham
989
views
S .shubham
asked
Oct 4, 2017
Programming in C
programming-in-c
+
–
0
votes
0
answers
1132
Geeks quiz c programming operators Q no.6 full explanation
Shubi
289
views
Shubi
asked
Oct 3, 2017
Programming in C
programming-in-c
+
–
4
votes
1
answer
1133
Programming
The following program #include<stdio.h> main ( ) { int abc ( ); abc ( ); (*abc) ( ); } int abc ( ) { printf (“come”);} (a) results in a compilation error (b) prints come come (c) results in a run-time error (d) prints come
The following program#include<stdio.h main ( ) { int abc ( ); abc ( ); (*abc) ( ); } int abc ( ) { printf (“come”);}(a) results in a compilation error (b) prints come...
Anup patel
4.7k
views
Anup patel
asked
Oct 3, 2017
Programming in C
programming-in-c
+
–
0
votes
0
answers
1134
Pointers
Priyendu Mori
449
views
Priyendu Mori
asked
Oct 1, 2017
Programming in C
programming-in-c
pointers
programming
+
–
3
votes
2
answers
1135
Programming
#include<stdio.h> #include<conio.h> #include<string.h> void main() { char *p="good"; char a[]="good"; printf("%d%d%d",sizeof(p),sizeof(*p),strlen(p)); printf("%d%d",sizeof(a),strlen(a)); getch(); } What will be output? Pls Explain
#include<stdio.h #include<conio.h #include<string.h void main() { char *p="good"; char a[]="good"; printf("%d%d%d",sizeof(p),sizeof(*p),strlen(p)); printf("%d%d",sizeof(a...
Anup patel
524
views
Anup patel
asked
Oct 1, 2017
Programming in C
programming-in-c
+
–
2
votes
2
answers
1136
c program
Consider the following code: int f(int num) { int result =0; if(num <= 1) return 1; else { for(i=num;i>=1;i--) result+=f(i/3); } return result; } Anyone plz explain this code line by line for input num=6????
Consider the following code:int f(int num){ int result =0; ...
Hira Thakur
1.6k
views
Hira Thakur
asked
Sep 27, 2017
Programming in C
programming-in-c
recursion
+
–
0
votes
0
answers
1137
Protogen eating plan will add up some
Protogen eating plan will add up some necessary proteins but at your 30s you need a power to maintain your difficult workouts period. That's where Protogen comes to offer enhance to your muscle tissue 1. L-Arginine Extract ... which reveals some amazing beneÚts of weight training technology. How does it work? http://naturalfitnesspoint.com/protogen/
Protogen eating plan will add up some necessary proteins but at your 30s you need a power to maintain your difficult workouts period. That’s where Protogen comes to of...
anonymous
192
views
anonymous
asked
Sep 27, 2017
Compiler Design
programming-in-c
+
–
0
votes
0
answers
1138
self doubt
what is the use of type qualifiers in C? provide some examples.
what is the use of type qualifiers in C? provide some examples.
chandra sai
244
views
chandra sai
asked
Sep 26, 2017
Programming in C
storage-classes-in-c
programming-in-c
+
–
0
votes
0
answers
1139
What is properly balanced paranthesis
Please explain What is properly balanced parenthesis? Keyword is properly. Kindly give some examples also.
Please explain What is properly balanced parenthesis?Keyword is properly. Kindly give some examples also.
iarnav
322
views
iarnav
asked
Sep 26, 2017
Programming in C
programming-in-c
data-structures
+
–
0
votes
1
answer
1140
geeks quiz
Parshu gate
610
views
Parshu gate
asked
Sep 26, 2017
Programming in C
programming-in-c
output
+
–
Page:
« prev
1
...
33
34
35
36
37
38
39
40
41
42
43
...
64
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register