Webpage

$$\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

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...
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; }
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; }
–1 vote
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; }
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;
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
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 ?
8
explain little bit more in easy way
9
plzzz explain how this code is executed
1 vote
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".$
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]); } }
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))); } }
1 vote
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; }
1 vote
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 ?
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"); } }
1 vote
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?
1 vote
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.