Login
Register
@
Dark Mode
Profile
Edit my Profile
Messages
My favorites
Register
Activity
Q&A
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous Years
Blogs
New Blog
Exams
Dark Mode
Webpage
Programming in C.
Recursion.
Filter
Recent
Hot!
Most votes
Most answers
Most views
Previous GATE
Featured
Recent questions in Programming and DS
0
votes
2
answers
5181
Fill up the blank in the following code for retrieving the element
A matrix $X$ of order $(N \times N)$ is stored in an array indexed from $0$ to $2N-2$, by first storing the diagonal, followed by anti diagonal. Fill up the blank in the following code for retrieving the element. if(i==j) return A[i-1]; else if(i+j == N+1) return __________ a) $A[N+i]$ b) $A[i-1]$ c) $A[N+i-1]$ d) $A[N-i+1]$
ajit
asked
in
Programming in C
Sep 7, 2015
by
ajit
665
views
0
votes
3
answers
5182
How to evaluate the remainder when we have a negative divisor?
main( ){ int i=-4, j, num=10; j = i % -3; j = j?0: num*num; printf(“j = %d”, j); } I tried with the formula $\boxed{\displaystyle \text{Dividend} = \left(\text{Quotient} \times \text{Divisor}\right)+\text{Remainder}}$, but got confused.
radha gogia
asked
in
Programming in C
Sep 3, 2015
by
radha gogia
749
views
2
votes
5
answers
5183
what is the output of the following program code?
void myfunc(int X){ if(X > 0) myfunc( --X ); printf("%d", X); } int main(){ myfunc(5); return 0; } 0,0,1,2,3,4 4,3,2,1,0 4,3,2,1,0,0 0,1,2,3,4
debanjan sarkar
asked
in
Programming in C
Sep 3, 2015
by
debanjan sarkar
6.5k
views
programming-in-c
0
votes
2
answers
5184
what would the program print?
#include<stdio.h> #include<math.h> int main() { double pi=3.1415926535; int a=1; int i; for(i=0;i<3;i++) if(a=cos(pi*i/2)) printf("%d",1); else printf("%d",0); } 0 0 0 0 1 0 1 0 1 1 1 1
ajit
asked
in
Programming in C
Sep 2, 2015
by
ajit
2.2k
views
programming-in-c
non-gate
8
votes
7
answers
5185
ISRO2014-32
What is the output of the following C program? #include<stdio.h> void main(void){ int shifty; shifty=0570; shifty=shifty>>4; shifty=shifty<<6; printf("The value of shifty is %o \n",shifty); } The value of shifty is 15c0 The value of shifty is 4300 The value of shifty is 5700 The value of shifty is 2700
ajit
asked
in
Programming in C
Sep 2, 2015
by
ajit
8.0k
views
programming-in-c
isro2014
output
43
votes
9
answers
5186
GATE CSE 1998 | Question: 19b
Compute the post fix equivalent of the following expression $3^*\log(x+1)-\frac{a}{2}$
Arjun
asked
in
DS
Aug 29, 2015
by
Arjun
15.6k
views
gate1998
stack
infix-prefix
descriptive
0
votes
0
answers
5187
How to calculate the sum of money in the below question ?
The sum of money in kept in a bank amounts to 1240 in 4 yrs and Rs 1600 in 10 yrs at Simple interst . then how to find sum ? I formed an AP 1240= a+(4-1)d 1600= a+(10-1) d but I am nt getting the answ where is my mistake ?
radha gogia
asked
in
Programming in C
Aug 23, 2015
by
radha gogia
591
views
0
votes
1
answer
5188
accessing the (n+1)th the element of an array of size n by using pointer
In an array A[n] of size n we can access the element A[n+1] by writting *(A+n+1) . Accessing the all the elements before and after the index can be done in 0(1) time complexity.So, why we will use a linked ... any no of elements after the end point of an array . The size of each node is also larger in case of linked list.
Saurav
asked
in
DS
Aug 23, 2015
by
Saurav
388
views
0
votes
1
answer
5189
Find the output of the following c code -
Find the output of the following c code- main() { char *ptr="gatebuddy"; *(ptr)++; ptr++; printf("%s\n",ptr); }
debanjan sarkar
asked
in
Programming in C
Aug 21, 2015
by
debanjan sarkar
1.1k
views
programming-in-c
pointers
0
votes
2
answers
5190
Difference in printing the address using %d and %u format specifier ?
I went through this article but couldn't get one point where it says that "It only makes a difference if the integer is negative (for signed inputs) or between INT_MAX+1 and UINT_MAX (e.g. between ... negative ? http://stackoverflow.com/questions/5208641/difference-between-printing-a-memory-address-using-u-and-d-in-c
radha gogia
asked
in
Programming in C
Aug 21, 2015
by
radha gogia
1.7k
views
programming-in-c
0
votes
2
answers
5191
How to explicitly initialize a pointer variable ?
int *ptr; ptr=9 ; // this is an error so to rectify it we write : int *ptr=(void*)9; why is this stmt true , what happens on type casting this 9 to a void pointer type since 9 is an integer constant .
radha gogia
asked
in
Programming in C
Aug 20, 2015
by
radha gogia
380
views
programming-in-c
1
vote
2
answers
5192
ISRO2014-39
If only one memory location is to be reserved for a class variable, no matter how many objects are instantiated, then the variable should be declared as extern static volatile const
ajit
asked
in
Programming in C
Aug 15, 2015
by
ajit
2.4k
views
programming
isro2014
runtime-environment
0
votes
4
answers
5193
solve it
int main() { int a; char *x; x = (char *) &a; a = 512; x[0] = 1; x[1] = 2; printf("%d\n",a); return 0; } output? A. M/C dependent B. 513 C. 258 D. compiler error
Vivek sharma
asked
in
Programming in C
Aug 13, 2015
by
Vivek sharma
1.3k
views
programming-in-c
non-gate
1
vote
2
answers
5194
what is the default return type of a function ?
#include <stdio.h> func(a,b); void main(){ printf("hello"); return 0; } here the code runs although it shows warning , so how is it that although func has no return type mentioned,it works . Also the return type of main is void but I am returning a value 0 , so then why is there no error here ?
radha gogia
asked
in
Programming in C
Aug 12, 2015
by
radha gogia
8.3k
views
programming-in-c
0
votes
1
answer
5195
Why does the below code produces error when one of its parameters have no data type associated with it ?
radha gogia
asked
in
Programming in C
Aug 10, 2015
by
radha gogia
403
views
programming-in-c
1
vote
2
answers
5196
what is the storage class of a global variable ?
If I write #include<stdio.h> int a; main() { //code } then since a is a global variable so what is the storage class of it , is it extern ?
radha gogia
asked
in
Programming in C
Aug 9, 2015
by
radha gogia
1.9k
views
programming-in-c
storage-classes-in-c
0
votes
2
answers
5197
when the function f returns a value then why is it not getting printed ?
#include<stdio.h> int f(); int main(){ printf("hello"); int a=f(); printf("%d",a); return 0; } int f(){ main(); return 8; } Why is 8 not printed here? I am a bit confused that after f returns, it returns 8, so a must be assigned 8. Then how come it is not getting printed?
radha gogia
asked
in
Programming in C
Aug 9, 2015
by
radha gogia
488
views
programming-in-c
0
votes
1
answer
5198
why is the below code compile time error and not run time error ?
#include<stdio.h> int f(); int main() { f(); return 0; }
radha gogia
asked
in
Programming in C
Aug 9, 2015
by
radha gogia
634
views
programming-in-c
0
votes
2
answers
5199
How to assign the address of 2-D array into a pointer variable ?
int B[2][3]; int *p = B; // why this is wrong? int (*p)[3] = B; // why this is correct?
radha gogia
asked
in
Programming in C
Aug 2, 2015
by
radha gogia
840
views
programming-in-c
1
vote
1
answer
5200
why does the ternary operator evaluates to a garbage value in the below code ?
#include<stdio.h> int main(){ int test=0; float a = 3424.34; printf("hello \n %d",(test? a: 3)); return 0; } It is giving output as hello 0 ,I am unable to understand the logic for this so plz clarify this .
radha gogia
asked
in
Programming in C
Jul 29, 2015
by
radha gogia
669
views
programming-in-c
Page:
« prev
1
...
255
256
257
258
259
260
261
262
263
264
265
...
309
next »
Subscribe to GATE CSE 2024 Test Series
Subscribe to GO Classes for GATE CSE 2024
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
-tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
Post GATE 2024 Guidance [Counseling tips and resources]
GATE CSE 2024 Result Responses
[Project Contest] Pytorch backend support for MLCommons Cpp Inference implementation
Participating in MLCommons Inference v4.0 submission (deadline is February 23 12pm IST)
IIITH PGEE 2024 Test Series by GO Classes
Subjects
All categories
General Aptitude
(3.5k)
Engineering Mathematics
(10.4k)
Digital Logic
(3.6k)
Programming and DS
(6.2k)
Programming
(4.1k)
DS
(2.0k)
Algorithms
(4.8k)
Theory of Computation
(6.9k)
Compiler Design
(2.5k)
Operating System
(5.2k)
Databases
(4.8k)
CO and Architecture
(4.0k)
Computer Networks
(4.9k)
Artificial Intelligence
(79)
Machine Learning
(48)
Data Mining and Warehousing
(25)
Non GATE
(1.4k)
Others
(2.7k)
Admissions
(684)
Exam Queries
(1.6k)
Tier 1 Placement Questions
(17)
Job Queries
(80)
Projects
(11)
Unknown Category
(870)
64.3k
questions
77.9k
answers
244k
comments
80.0k
users
Recent questions in Programming and DS
Recent Blog Comments
category ?
Hi @Arjun sir, I have obtained a score of 591 in ...
download here
Can you please tell about IIT-H mtech CSE self...
Please add your admission queries here:...
Network Sites
GO Mechanical
GO Electrical
GO Electronics
GO Civil
CSE Doubts
Aptitude Overflow