Recent questions in Programming in C

#61
425
views
2 answers
2 votes
#62
1.7k
views
1 answers
1 votes
What will be the output of the following C program? If you think it will give a runtime error, you need to mention it. In either case,your answer must include proper just...
#63
946
views
1 answers
1 votes
I have learnt that order of function call of f1() and f2() is compiler dependent from K&R book.Why precedence and associavity does not work in this case ?? Please clarify...
#64
1.2k
views
1 answers
0 votes
I am unable to understand the error code. What does 'invalid conversion from int to int mean ? plz help.The code-#include <stdio.h>int function(int *);int main(){ int ...
#65
661
views
2 answers
0 votes
My question is when I give :i/p - abcdehow i get output - abcde .I mean C is a character so shouldn't o/p also be an single character . Why is o/p coming out to be be str...
#66
468
views
1 answers
0 votes
My question is when I give :i/p - $abcde$how i get output - $abcde$ .I mean C is a character so shouldn't o/p also be an single character . Why is o/p coming out to be be...
#67
415
views
1 answers
0 votes
int c=31, n;scanf(“%d”,&n);int k=n<<c;if(k&&1) return 1;return 0;
#68
562
views
1 answers
0 votes
Find the out put of the following C program. main() { char *ptr = "techtud"; char p= (*ptr)++; printf("%s\n",ptr); }the output of the program came as$?$
#69
431
views
1 answers
1 votes
What does the following program print?int data[3][4] = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}}; int main(void) { int r, c; for(r = 0; r < 3; r++) for(c = 0; c < 4; ...
#71
453
views
1 answers
1 votes
// Graph class represents a undirected graph// using adjacency list representationclass Graph{ int V; // No. of vertices // Pointer to an array containing adjac...
#72
897
views
2 answers
2 votes
why is it showing error??#include <stdio.h>int main() { extern int i; i=20; printf("%d",i);}
#73
1.3k
views
2 answers
1 votes
I am getting segmentation fault for the following code.Please help to rectify. #include <stdio.h #include <stdlib.h struct person { int age; float weight; char *name; }; ...
#74
1.2k
views
1 answers
1 votes
Write an algorithm of the given problemGiven a chess board of order NxM and source points (s1,s2) and destination points (d1,d2), Your task to find min number of moves re...
#75
1.4k
views
2 answers
1 votes
WAP where smallest subarrays with sum greater than x?Say an array={1,5,6,2,45,17};Now, x=60Now we have to find smallest subarray which is greater than x
#76
3.3k
views
4 answers
3 votes
#77
4.4k
views
2 answers
1 votes
what is the difference between all these types of trees1)full binary tree 2) complete binary tree 3) almost complete binary tree 4)perfect binary tree 5)strictly binary t...
#78
622
views
2 answers
1 votes
#include <stdio.h int K = 4; int a ; unsigned int m; int* check(unsigned int n) { int res = 1; int count = 0; for(int i=0;i<K;i++) if(!(n&(1<<i))) { count++; res = 0; } a...
#79
844
views
1 answers
1 votes
Can someone explain the difference between abstraction and encapsulation with programming example?
#80
501
views
1 answers
1 votes
int main(){ int a[5]={1,2,3,4,5}; char *str="hello"; printf("%p %p",a,&a); printf("%p %p",str,&str); }Why in $1$st printf , both the outputs are same($a$,&$a$)And in $2$n...