search
Log In

Webpage

Programming in C. Recursion.

$$\small{\overset{{\large{\textbf{Mark Distribution in Previous GATE}}}}{\begin{array}{|c|c|c|c|c|c|c|c|}\hline
\textbf{Year}&\textbf{2019}&\textbf{2018}&\textbf{2017-1}&\textbf{2017-2}&\textbf{2016-1}&\textbf{2016-2}&\textbf{Minimum}&\textbf{Average}&\textbf{Maximum}
\\\hline\textbf{1 Mark Count}&2&2&1&2&2&1&1&1.7&2
\\\hline\textbf{2 Marks Count}&3&3&4&4&2&2&2&3&4
\\\hline\textbf{Total Marks}&8&8&9&10&6&5&\bf{5}&\bf{8}&\bf{10}\\\hline
\end{array}}}$$

Recent questions in Programming

0 votes
1 answer
1
#include <stdio.h> #include<stdlib.h> int main() { //code char *ptr,s[]="debasree"; ptr=s[0]; printf("%s\n",*ptr); return 0; } I get this warning in geeks for geeks compiler Warnings: prog.c: In function 'main': prog.c:7:6: warning: assignment ... Segmentation Fault (SIGSEGV) can anyone pls explain what is the warning saying? i googled a lot but could not grasp it pls pls pls pls explain...
asked Apr 24, 2019 in Programming debasree88 332 views
0 votes
1 answer
2
Assume that an integer and a pointer each takes 4 bytes. Also assume there is no alignment in objects. Predict the output #include <iostream> using namespace std; class Test{ static int x; int *ptr; int y; }; int main() { // your code goes here Test t; int a; cout<<sizeof(t)<<"\n"; cout<<sizeof(Test *); return 0; }
asked Apr 23, 2019 in Programming N 293 views
0 votes
1 answer
3
int main(); { int a,*b,**c,***d,****e; a=10; b=&a; c=&b; d=&c; e=&d; print f(“a=%d b=%u c=%u d=%u e=%u e=%u\n”, a,b,c,d,e); print f(“ %d %d %d \n”,a,a+*b,**c+***d+,****e); return 0; }
asked Apr 12, 2019 in Programming altamash 101 views
–1 vote
0 answers
4
void fun(int,int*); int main() { int=-5,j=-2; fun(i,&j); print f(“i=%d j=%d\n”,i,j); return 0; } void fun(int i,int *j) { i=i*i; *j=*j * *j; }
asked Apr 12, 2019 in Programming altamash 96 views
0 votes
1 answer
5
X=2; Y=++x * ++x * ++x ; Printf("%d",Y); In the above question, we have to use the final value of x or it will be evaluated seperately and then multiplied. Ex: Y= 3*4*5; or Y=5*5*5;
asked Apr 11, 2019 in Programming Ashish Roy 1 181 views
0 votes
0 answers
6
Consider the following C function definition: int trial (int a,int b,int c) { if ((a>=b) && (c<b)) return b; else if (a>=b) return Trial(a,c,b); else return Trial(b,a,c); } The function Trial : A) Finds the maximum of a,b,c B) Finds the minimum of a,b,c C)Finds the middle number of a,b,c D) None of these
asked Apr 10, 2019 in Programming Aishvarya Akshaya Vi 91 views
0 votes
1 answer
7
What will happen if using MALLOC ( ) we allocate entire memory from heap and we don't free it using FREE( ) ? what will happen next ?
asked Apr 10, 2019 in Programming hitendra singh 52 views
0 votes
1 answer
8
–2 votes
0 answers
9
plzzz explain how this code is executed
asked Apr 8, 2019 in Programming saket nandan 107 views
1 vote
1 answer
10
Write a $C$ program to fins all permutations of a string (having at most 6 characters). For example, a string of $3$ characters like $“abc"$ has 6 possible permutations: $“abc", “acb", “bca", “bac", “cab", “cba".$
asked Apr 8, 2019 in Programming akash.dinkar12 175 views
0 votes
2 answers
11
i write this program, during initialization of array i given the size as 11 means the number of elements stored in an array is 11. as we know array is not assigned a value of index 12 and above. but in in the program array a is initialized of index from 0 to 19,my question is how the array is initialized with 20 ... ; for(i=0;i<20;i++) { a[i]=i+1; } for(i=0;i<20;i++) { printf("%d\n",a[i]); } }
asked Apr 7, 2019 in Programming shiva0 266 views
0 votes
1 answer
12
how to know how much size is allocated while dynamically allocating memory to the pointer variable with malloc. i just write the below code to know the size of ptr2 after dynamically allocating memory. i want the output is 10 but it is displaying as 2 as( 8 / 4 ) #include<stdio.h> ... NULL) printf("memory allocation failed"); else{ printf("size of *ptr2 is == %d\n",(sizeof(ptr2)/sizeof(int))); } }
asked Apr 6, 2019 in Programming shiva0 139 views
1 vote
3 answers
13
What is the output of the program? int main() { union a { int i; char ch[2]; }; union a u; u.ch[0] = 3; u.ch[1] = 2; printf("%d, %d, %d", u.ch[0], u.ch[1], u.i); return 0; }
asked Apr 3, 2019 in Programming shiva0 136 views
1 vote
1 answer
14
struct node { int data1; char data2; struct node* link; }; //self referential structure *************************************** struct node { int data1; char data2; } m; int main () { struct node * ptr; return 0; } are both pointer ptr & link will do same work every where? All I need to ask is difference between self referential structure and Pointer to Structure ?
asked Apr 3, 2019 in Programming hitendra singh 89 views
0 votes
0 answers
15
Can somebody explain this code line by line. I am unable to get and what will be it's output? #include<stdio.h> #include<stdlib.h> void transpose(int n, const double *A, double *B, const int *lda, int *perm) { } int transpose_equal(const double *A, const double*B, int total_size ... (ndim, B_trans, B, r_dim, r_perm); transpose_equal(A, B, total); free(A); free(B); free(B_trans); printf("\n"); } }
asked Apr 3, 2019 in Programming srestha 112 views
1 vote
1 answer
16
1. #include <stdio.h> int main() { int i; char a[] = ""; // no tab space in between if(printf("%s",a)) printf("string empty"); else printf("string is not empty"); return 0; } Output: string is not empty 2. #include <stdio.h> int main() { int i; char a ... space in between if(printf("%s",a)) printf("string empty"); else printf("string is not empty"); return 0; } Output: string empty Why and how so?
asked Apr 1, 2019 in Programming Reshu $ingh 78 views
1 vote
2 answers
17
#include <stdio.h> int main() { int i = 258; int *iptr = &i; printf("%d",*(char*)iptr); printf("%d",*(char*)iptr+1); } Please explain the solution.
asked Mar 31, 2019 in Programming Reshu $ingh 190 views
0 votes
0 answers
18
FOR THE EXTENDED-SHORTEST-PATH if we want to find the distance between 1->4 and the 1->5 +5->4 gives the shortest path and if 1->5 gets its shortest path as 1->2->5 and 5>4 gets its shortest path as 5->3->4 then how will we get it?? as one of the operands is always from the initial array.
asked Mar 30, 2019 in Programming Doraemon 48 views
0 votes
0 answers
19
A directed acyclic graph has no connected components. TRUE OR FALSE???
asked Mar 30, 2019 in Programming Doraemon 38 views
0 votes
0 answers
20
For multiplication method in hashing the formula is h(k)=m* (KA mod 1); m=2^p, k=key , 0<A<1 My question is how does it actually works. Please explain in a detailed way.
asked Mar 29, 2019 in Programming Doraemon 46 views
...