Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged programming-in-c
0
votes
1
answer
661
# c questions
#define cube(x) x*x*x main(){ int a=3,b; b=cube(a++); printf("% d % d",a,b); }
#define cube(x) x*x*xmain(){int a=3,b;b=cube(a++);printf("% d % d",a,b);}
amit166
595
views
amit166
asked
Nov 22, 2018
Programming in C
programming-in-c
+
–
1
votes
1
answer
662
How is the time Complexity of this problem O(n log log n)?
int A(int n){ for(i = 1; i < n; i++) for(j = 1; j < i; j *= 2) for(k = j; k >= 1; k /= 2) if(n = 0) return 1; else{ for(z = 0; z < n; z++){ // do something } } } How do find the complexity of this problem? The answer is supposed to be O(n log log n), but it maybe wrong.
int A(int n){ for(i = 1; i < n; i++) for(j = 1; j < i; j *= 2) for(k = j; k >= 1; k /= 2) if(n = 0) return 1; else...
gmrishikumar
4.2k
views
gmrishikumar
asked
Nov 22, 2018
Algorithms
algorithms
time-complexity
recurrence-relation
programming-in-c
+
–
0
votes
0
answers
663
made easy
Consider the following c code int f(int x) { if(x<1) return 1; else return f(x-1)+g(x); } int g(int x) { if (x<2) return 1; else return f(x-1)+g(x/2); } Of the following ,which best describes the growth of f(x) as a function of x? a) logarithmic b) quadratic c) linear d)exponential
Consider the following c code int f(int x) { if(x<1) return 1; else return f(x-1)+g(x); } int g(int x) { if (x<2) return 1; else return f(x-1)+g(x/2); }Of the following ,...
Piyush mishra
475
views
Piyush mishra
asked
Nov 21, 2018
Algorithms
programming-in-c
+
–
0
votes
1
answer
664
MadeEasy Workbook: Programming & DS - Programming In C
Options are 73 396 109 360 Answer given in book is 109. Can anyone tell me how ?
Options are73396109360 Answer given in book is 109.Can anyone tell me how ?
Jyoti Kumari97
1.0k
views
Jyoti Kumari97
asked
Nov 21, 2018
Programming in C
programming
programming-in-c
made-easy-booklet
+
–
1
votes
0
answers
665
signed and unsigned integers
int main() { unsigned int a = 1000; int b = -1; if (a>b) printf("A is BIG! %d\n", a-b); else printf("a is SMALL! %d\n", a-b); return 0; } the answer to this question is "a is small,1001 " ... unsigned integer its value is MAX+ (-MAX+1001)=1001 3.The presence of "%d " in printf has no effect ,the result will be unsigned always
int main(){ unsigned int a = 1000;int b = -1;if (a>b) printf("A is BIG! %d\n", a-b);else printf("a is SMALL! %d\n", a-b); return 0;} the answer to this question is "a is ...
codingo1234
1.2k
views
codingo1234
asked
Nov 20, 2018
Programming in C
programming-in-c
+
–
0
votes
1
answer
666
Extern Variable
Na462
1.5k
views
Na462
asked
Nov 19, 2018
Programming in C
programming-in-c
extern-variable
+
–
0
votes
0
answers
667
What will be Final Content of Array
Na462
531
views
Na462
asked
Nov 19, 2018
Programming in C
algorithms
programming-in-c
array
+
–
0
votes
1
answer
668
Gateforum Test Series: Programming & DS - Programming In C
What will be the output of the following program [Addresses of the variables are assigned continuous] #include<stdio.h> void main() { int a = 4, b = 8, c = 12, d, e, f ; int *x=&a , *y=&b, *z =&c ; d =x - y ; e =y - z ; f = d - e ; printf("%d" ; f) ; } (A)Compiler error (B) -8; (C)8; (D) 2;
What will be the output of the following program[Addresses of the variables are assigned continuous]#include<stdio.h>void main(){int a = 4, b = 8, c = 12, d, e, f ;int *x...
Mahbub Alam
534
views
Mahbub Alam
asked
Nov 19, 2018
Programming in C
gateforum-test-series
programming
programming-in-c
+
–
0
votes
1
answer
669
Gateforum Test Series: Programming & DS - Programming In C
#include<stdio.h> void main() { int i ; for(i=0; i<5; i++) f() ; } void f() { static int x ; x=5 ; x++ ; printf("%d", x); } OUTPUT OF THE FUNCTION IS (A)6,6,6,6,6 (B)6,7,8,9,10 (C)5,5,5,5,5 (D)5,6,7,8,9
#include<stdio.h>void main(){ int i ;for(i=0; i<5; i++)f() ;}void f(){static int x ;x=5 ;x++ ;printf("%d", x);}OUTPUT OF THE FUNCTION IS(A)6,6,6,6,6(B)6,7,8,9,10(C)5,5,5,...
Mahbub Alam
244
views
Mahbub Alam
asked
Nov 19, 2018
Programming in C
gateforum-test-series
programming
programming-in-c
+
–
0
votes
1
answer
670
Static Variable
Is it static declaration or static assignment? int main() { int x=20; static int y=x; if(x==y) printf("Equal"); else printf("Not Equal"); return 0; } What is output?and why?
Is it static declaration or static assignment?int main() { int x=20; static int y=x; if(x==y) printf("Equal"); else printf("Not Equal"); return 0; }What is output?and why...
srestha
1.3k
views
srestha
asked
Nov 18, 2018
Programming in C
programming-in-c
+
–
1
votes
1
answer
671
Gateforum Test Series: Programming & DS - Programming In C
Shivam Kasat
699
views
Shivam Kasat
asked
Nov 17, 2018
Programming in C
gateforum-test-series
programming
programming-in-c
+
–
2
votes
1
answer
672
Gateforum Test Series: Programming & DS - Programming In C
Shivam Kasat
635
views
Shivam Kasat
asked
Nov 17, 2018
Programming in C
gateforum-test-series
programming
programming-in-c
+
–
0
votes
0
answers
673
gateforum_test_series
Shivam Kasat
152
views
Shivam Kasat
asked
Nov 17, 2018
Programming in C
gateforum-test-series
programming-in-c
+
–
0
votes
1
answer
674
Gateforum Test Series: Programming & DS - Programming In C
Shivam Kasat
823
views
Shivam Kasat
asked
Nov 17, 2018
Programming in C
gateforum-test-series
programming-in-c
programming
+
–
0
votes
0
answers
675
programming
#include<stdio.h> int(*foo())[3] { static int a[3]={1,2,3}; printf("%d",*a); return &a; } int main() { static int (*p)[3]; p=foo(); printf("%d",*(*p+2)); return 0; } i try to make picture representation i think this is wrong please make correct
#include<stdio.h int(*foo())[3] { static int a[3]={1,2,3}; printf("%d",*a); return &a; } int main() { static int (*p)[3]; p=foo(); printf("%d",*(*p+2)); r...
Gurdeep Saini
412
views
Gurdeep Saini
asked
Nov 16, 2018
Programming in C
programming-in-c
programming
+
–
0
votes
1
answer
676
Parameter Passing
Predict the Output for both the snippets for the following: 1. Call by Value 2. Call by Reference 3. Call by Need 4. Call by Name 5. Call by value Result/Call by value Return(Copy Restore) 6. Call by Text
Predict the Output for both the snippets for the following:1. Call by Value2. Call by Reference3. Call by Need4. Call by Name5. Call by value Result/Call by value Return(...
Balaji Jegan
1.3k
views
Balaji Jegan
asked
Nov 15, 2018
Programming in C
programming-in-c
parameter-passing
+
–
0
votes
0
answers
677
series test -Testbook
int main() { int x = -4; unsigned char z = 10; if (x > z) printf("x>z\n"); else printf("x<z\n"); return 0; }
int main() { int x = -4; unsigned char z = 10; if (x z) printf("x>z\n"); else printf("x<z\n"); return 0; }
Mahbub Alam
263
views
Mahbub Alam
asked
Nov 15, 2018
Programming in C
programming-in-c
+
–
1
votes
0
answers
678
ACE BOOK , c-programming
what is the result of comparing signed with unsigned number?? #include <stdio.h> int main() { unsigned int a = 5; if(a > -1) printf("5 is > -1\n"); return 0; }
what is the result of comparing signed with unsigned number??#include <stdio.h>int main(){ unsigned int a = 5;if(a -1)printf("5 is -1\n"); return 0; }
Mahbub Alam
575
views
Mahbub Alam
asked
Nov 15, 2018
Programming in C
programming-in-c
output
programming
+
–
0
votes
0
answers
679
Test-Series
Can anyone please explain the functioning of the statement (specified in bold) ? #include <stdio.h> void main(){ int p = -8; int i = (p++, ++p); printf("%d\n", i); }
Can anyone please explain the functioning of the statement (specified in bold) ?#include <stdio.h>void main(){int p = -8;int i = (p++, ++p);printf("%d\n", i);}
the_bob
729
views
the_bob
asked
Nov 10, 2018
Programming in C
programming-in-c
output
+
–
0
votes
0
answers
680
Self doubt C programming
https://gateoverflow.in/45555/c-programming-predict-the-output main() { { extern int i; int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); } int i; rude explained how output is printed but its giving error when i'm trying to run the program here https://ideone.com/xteXgV
https://gateoverflow.in/45555/c-programming-predict-the-outputmain() { { extern int i; int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } print...
Mk Utkarsh
620
views
Mk Utkarsh
asked
Nov 10, 2018
Programming in C
programming-in-c
output
+
–
0
votes
1
answer
681
C programming
#include<stdio.h> void fun(int *p,int *q) { p=q; *p=q; } int i=0,j=1; int main() { fun(&i,&j); printf("%d%d",i,j); } What will be the output of i and j in 16-bit C Compiler?
#include<stdio.h void fun(int *p,int *q) { p=q; *p=q; } int i=0,j=1; int main() { fun(&i,&j); printf("%d%d",i,j); }What will be the output of i and j in 16-bit C Compiler...
Mr khan 3
1.0k
views
Mr khan 3
asked
Nov 3, 2018
Programming in C
programming-in-c
output
programming
pointers
+
–
0
votes
0
answers
682
made easy
What is the output of the following program if dynamic scoping is used? int a,b,c; void func1(){ int a,b; a=6; b=8; func2(); a=a+b+c; print(a); } void func2(){ int b,c; b=4; c=a+b; a+=11; print(c); } void main(){ a=3; b=5; c=7; func1(); } a)7 19 b)10 1 c)10 23 d)10 32
What is the output of the following program if dynamic scoping is used? int a,b,c; void func1(){ int a,b; a=6; b=8; func2(); a=a+b+c; print(a); } void func2(){ int b,c; b...
Piyush mishra
1.3k
views
Piyush mishra
asked
Oct 27, 2018
Programming in C
programming-in-c
+
–
0
votes
0
answers
683
C programming quiz Question#5
output of the following C code is: int main() { int a=520; char *ptr; ptr=(char *)&a; printf("%d",*ptr); return 0; } Assume that values are stored in little-endian format.What it mean??
output of the following C code is:int main() { int a=520; char *ptr; ptr=(char *)&a; printf("%d",*ptr); return 0; }Assume that values are stored in little-endia...
Lakshman Bhaiya
640
views
Lakshman Bhaiya
asked
Oct 25, 2018
Programming in C
programming-in-c
+
–
0
votes
0
answers
684
C Programming quiz
Consider the following C-fragment: #include<stdio.h> int(*foo())[3] { int a[3]={1,2,3}; printf("%d",*a); return &a; } int main() { int (*p)[3]; p==foo(); printf("%d",*(*p+2)); return 0; } $A)13$ $B)10$ $C)31$ $D)Compilation$ $error$
Consider the following C-fragment:#include<stdio.h int(*foo())[3] { int a[3]={1,2,3}; printf("%d",*a); return &a; } int main() { int (*p)[3]; p==foo(); prin...
Lakshman Bhaiya
1.6k
views
Lakshman Bhaiya
asked
Oct 25, 2018
Programming in C
programming-in-c
output
+
–
0
votes
1
answer
685
2D-array
A is a 2D-array with the range [-5....5,3......13] of elements.The starting location is 100. each element accupies 2 memeory cells. Calculate the location of A[0][8] using column major order and row major order.Does indexing matter??Why C follow $0$ indexing??
A is a 2D-array with the range [-5....5,3......13] of elements.The starting location is 100. each element accupies 2 memeory cells.Calculate the location of A[0][8] using...
Lakshman Bhaiya
3.2k
views
Lakshman Bhaiya
asked
Oct 22, 2018
Programming in C
programming-in-c
array
+
–
0
votes
0
answers
686
Function and array
Predict the value returned by the function MyFunc(). int MyX(int *E, unsigned int size) { int Y = 0; int Z; int i, j, k; for(i = 0; i< size; i++) Y = Y + E[i]; for(i=0; i < size; i++) for(j = i; j < size; j++) { Z ... $C)$ Sum of the maximum element in all sub-arrays of array arr $D)$ Sum of all the elements in the array arr
Predict the value returned by the function MyFunc().int MyX(int *E, unsigned int size) { int Y = 0; int Z; int i, j, k; for(i = 0; i< size; i++) Y = Y + E[i]; for(i=0; i ...
Lakshman Bhaiya
479
views
Lakshman Bhaiya
asked
Oct 22, 2018
Programming in C
programming-in-c
array
+
–
2
votes
0
answers
687
MultiDimensional Array
What is the Output of following Array ? A. 8 10 B. 10 8 C. 10 2 D. 8 1 E. Garbage value
What is the Output of following Array ? A. 8 10B. 10 8C. 10 2D. 8 1E. Garbage value
Na462
2.0k
views
Na462
asked
Oct 20, 2018
Programming in C
programming-in-c
array
+
–
0
votes
1
answer
688
Programming
Void Test (int arr[], int s, int e) { int temp; if(s >= e) return; temp = arr[s+1]; arr[s+1] = arr[e]; arr[e] = temp; Test(arr, s+1, e - 1) }
Void Test (int arr[], int s, int e) { int temp; if(s >= e) return; temp = arr[s+1]; arr[s+1] = arr[e]; arr[e] = temp; Test(arr, s+1, e - 1) }
Vikas Verma
545
views
Vikas Verma
asked
Oct 19, 2018
Programming in C
programming-in-c
+
–
3
votes
1
answer
689
Programming execution doubt
#include<stdio.h> #define type int type foo(type b) { return b*b; } #undef type #define type float int main() { float a = foo(1.1); printf("%1.2f", a); } Please explain line by line execution of this program.
#include<stdio.h #define type int type foo(type b) { return b*b; } #undef type #define type float int main() { float a = foo(1.1); printf("%1.2f", a); } Please explain li...
Mk Utkarsh
891
views
Mk Utkarsh
asked
Oct 19, 2018
Programming in C
programming-in-c
+
–
1
votes
0
answers
690
Explain the following
Please explain this.
Please explain this.
Abhisek Saha
441
views
Abhisek Saha
asked
Oct 14, 2018
Programming in C
programming-in-c
array
pointers
+
–
Page:
« prev
1
...
18
19
20
21
22
23
24
25
26
27
28
...
64
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register