Recent questions tagged programming-in-c

0 votes
1 answer
1083
In C language, bitwise operation can be applied to which of the following operandsA. char B. int C. short, long ...
1 votes
1 answer
1084
1 votes
1 answer
1085
What does the following fragment of C- program print?char t[] = "PROGRAM1234"; char *r = t; printf ("%s", r + r[6]- r[3]);Explain.
0 votes
1 answer
1086
Let A be a square matrix of size n x n. Consider the following program. What is the expected output?C = 100 for(i=0; i<n; i++) for (j=0; j<n; j++) { Temp = A[i][j] + C A[...
0 votes
1 answer
1088
i am getting 7 but ans given is 6.
0 votes
1 answer
1089
#include <stdio.h>#define R 10#define C 20int main(){ int (*p)[R][C]; printf("%d", sizeof(*p)); getchar(); return 0;}a200B4c800D80
1 votes
1 answer
1090
Why does this code:char *p = "hello, world!"; p[0] = 'H';crash?
–1 votes
0 answers
1091
2 votes
2 answers
1093
OPTIONSA)7,19 B) 10,1 C) 10,23 D)10,32
0 votes
3 answers
1094
ptrdata is a pointer to a data type . The expression *ptrdata++ is evaluated as ( in C++) a) *(ptrdata++) b) (*ptrdata)++c) *(ptrdata)++ d) depends on compiler
3 votes
2 answers
1097
2 votes
2 answers
1098
#include<stdio.h int fun(int a,int b) { if(b==0) return 0; if(b%2==0) return fun(a+a,b/2); return fun(a+a,b/2)+a; } int main() { printf("%d",fun(9,11)); return 0; }
3 votes
0 answers
1099
What is the function of x and n computed by the below code segmentint myprog(int x,int n) { int val=1; if(n>0){ if((n%2)==1) val=val*x; val=val*myprog(x*x,n/2); } return ...
5 votes
2 answers
1100
Consider the following functionVoid func(int n){Int k=n;Int i=0;for(;i<n;i++){while(k>1){k>>=1;}}What is the worst case time complexity of the function?
2 votes
1 answer
1102
1 votes
1 answer
1103
Choose the right option.#define X 8 int main(void) { cout<<++X; return 0; }A) 8 B) 9C) Garbage Value C) Compile Error
4 votes
0 answers
1105
What is the output of the following code snippetchar ptr[]="Gateoverflow.in"; char qtr[]="GATE"; int i=0; for(;ptr[i++]=qtr[i++];); printf("%s\n",ptr);
1 votes
2 answers
1106
fun(a,b) { if(a<0 && b<0) return 0; else if(a==0) return b+1; else if(b==0) return fun(a-1,1); else return fun(a-1,fun(a,b-1)); }compute fun(3,1)
0 votes
0 answers
1107
Value of following function when x=3 and y=5int f(int x, int y) { if(x==0 && y>=0) return y+1; else if(x>0 && y==0) return(x-1,1); else if(x>0 && y>0) return(f(x-1),f(x,y...