Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged programming-in-c
5
votes
1
answer
31
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 26
What will be the output of the following C program? #include<stdio.h> void main() { int i=6; for(--i; --i; i--) { printf("%d",i); } } $42$ $31$ Infinite loop None of these
What will be the output of the following C program?#include<stdio.h void main() { int i=6; for( i; i; i ) { printf("%d",i); } }$42$$31$Infinite loopNone of these
GO Classes
475
views
GO Classes
asked
Jan 21
Programming in C
goclasses2024-mockgate-12
goclasses
programming
programming-in-c
output
2-marks
+
–
1
votes
1
answer
32
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 27
Consider the following C program:- #include <stdio.h> void ubswap(int **a, int **b) { int* temp = *a; *a = *b; *b = temp; } int main() { int x = 1, y = 9; int* u = &x; int* v = &y; int** a = &u; int** b ... $\text{ return 0 }?$ $x$ and $y$ $u$ and $v$ $a$ and $b$ None of the above
Consider the following C program:-#include <stdio.h void ubswap(int a, int b) { int* temp = *a; *a = *b; *b = temp; } int main() { int x = 1, y = 9; int* u = &x; int* v...
GO Classes
479
views
GO Classes
asked
Jan 21
Programming in C
goclasses2024-mockgate-12
goclasses
programming
programming-in-c
pointers
2-marks
+
–
4
votes
2
answers
33
GO Classes Test Series 2024 | Mock GATE | Test 11 | Question: 21
Consider the following two blocks of code, found in separate files: /* main.c */ int main() { int i=0; foo(); return 0; } /* foo.c */ int i=1; void foo() { printf( %d , i); } What will happen when you attempt to ... ? It will fail to compile. It will fail to link. It will print " $0$ ". It will print " $1$ ".
Consider the following two blocks of code, found in separate files:/* main.c */ int main() { int i=0; foo(); return 0; }/* foo.c */ int i=1; void foo() { printf(“%d”,...
GO Classes
922
views
GO Classes
asked
Jan 13
Programming in C
goclasses2024-mockgate-11
goclasses
programming
programming-in-c
recursion
1-mark
+
–
1
votes
1
answer
34
GO Classes Test Series 2024 | Mock GATE | Test 11 | Question: 22
What will the following print: int a, b, c, *d; a = 0; b = 1 ; c = 2 ; d = & a; (*d) += b+c; d = & b; (*d) += a+b+c ; printf("a= %i b=%i\n", a, b); $a=0, b=3$ $a=3, b=3$ $a=3, b=4$ $a=3, b=7$
What will the following print:int a, b, c, *d; a = 0; b = 1 ; c = 2 ; d = & a; (*d) += b+c; d = & b; (*d) += a+b+c ; printf("a= %i b=%i\n", a, b);$a=0, b=3$$a=3, b=3$$a=3...
GO Classes
412
views
GO Classes
asked
Jan 13
Programming in C
goclasses2024-mockgate-11
goclasses
programming
programming-in-c
pointers
1-mark
+
–
6
votes
1
answer
35
GO Classes Test Series 2024 | Mock GATE | Test 11 | Question: 23
What will be the output on the execution of the following code segment? main() { unsigned num1=-1; signed num2=1; if(num1 < num2) printf("less"); else if(num1>num2) printf("greater"); else if(num1==num2) printf("equal"); } greater less equal error
What will be the output on the execution of the following code segment?main() { unsigned num1=-1; signed num2=1; if(num1 < num2) printf("less"); else if(num1>num2) printf...
GO Classes
511
views
GO Classes
asked
Jan 13
Programming in C
goclasses2024-mockgate-11
goclasses
programming
programming-in-c
output
1-mark
+
–
3
votes
3
answers
36
GO Classes Test Series 2024 | Mock GATE | Test 11 | Question: 47
What will be the output of the following program? #include<stdio.h> void swap(char **s1, char **s2){ char *tmp; tmp=*s1; *s1=*s2; *s2=tmp; } int main() { char *str[3]= {"orange", "apple", ... %s %s", strs[0], strs[1], strs[2]); } pear apple orange apple pear orange orange apple pear apple orange pea
What will be the output of the following program?#include<stdio.h void swap(char s1, char s2){ char *tmp; tmp=*s1; *s1=*s2; *s2=tmp; } int main() { char *str[3]= {"oran...
GO Classes
365
views
GO Classes
asked
Jan 13
Programming in C
goclasses2024-mockgate-11
goclasses
programming
programming-in-c
array
array-of-pointers
2-marks
+
–
6
votes
1
answer
37
GO Classes Test Series 2024 | Mock GATE | Test 11 | Question: 48
Consider the following pair of mutually recursive functions. What does $g(g(2))$ evaluate to? int f(int n){ if (n==0) return 0; return f(n-1)+g(n-1); } int g(int n){ if (n==0) return 1; return g(n-1) + f(n); }
Consider the following pair of mutually recursive functions. What does $g(g(2))$ evaluate to?int f(int n){ if (n==0) return 0; return f(n-1)+g(n-1); } int g(int n){ if (n...
GO Classes
425
views
GO Classes
asked
Jan 13
Programming in C
goclasses2024-mockgate-11
goclasses
numerical-answers
programming
programming-in-c
recursion
2-marks
+
–
1
votes
1
answer
38
Programming
Which of the following is TRUE? A Scope of static variable is within the body of function where it is declared. B Same variable can be declared multiple times within the same function only if it is extern storage class. C Malloc always returns base address of block of memory allocated. D None of the above This is a multiple select question
Which of the following is TRUE?A Scope of static variable is within the body of function where it is declared.B Same variable can be declared multiple times within the sa...
practicalmetal
196
views
practicalmetal
asked
Jan 9
Programming in C
programming-in-c
made-easy-test-series
+
–
1
votes
1
answer
39
Made Easy Mock Test
Rohit Chakraborty
223
views
Rohit Chakraborty
asked
Jan 7
GATE
made-easy-test-series
programming-in-c
+
–
0
votes
0
answers
40
#Float Data Type
#include <iostream> using namespace std; int main() { float a,b,c; cout<<"Enter a="; cin>>a; b=a + (1-1); cout<<"a + (1-1)="<<b<<endl; c=(a+1)-1; cout<<" (a+1)-1="<<c; getchar(); } Here is a is till 1E-7 c gives us a value .but after a= 1E-8 c gives us 0 can you explain how float data type is working here
#include <iostream>using namespace std;int main(){ float a,b,c; cout<<"Enter a="; cin>>a; b=a + (1-1); cout<<"a + (1-1)="<<b<<endl; c=(a+1)-1; cout<...
Rajib Datta Roy
180
views
Rajib Datta Roy
asked
Dec 26, 2023
Programming in C
programming-in-c
+
–
0
votes
0
answers
41
testbook
Rohit Chakraborty
125
views
Rohit Chakraborty
asked
Dec 24, 2023
Programming in C
testbook-test-series
programming-in-c
recursion
+
–
2
votes
1
answer
42
#c #cprogram
#include<stdio.h> int main() { int i; for(i =-1;i<sizeof(i);i++) printf("%d",i); } The output of the code is didn't enter to the loop and prints nothing. Can anyone explain
#include<stdio.h>int main() {int i;for(i =-1;i<sizeof(i);i++)printf("%d",i);}The output of the code is didn't enter to the loop and prints nothing.Can anyone explain
Varadaraju D
216
views
Varadaraju D
asked
Dec 6, 2023
Study Resources
programming-in-c
query
+
–
0
votes
1
answer
43
Made Easy test series. Doubt: My output for this question is => 1,2 and this isn't present in any of the options. Can someone please help me understand this, as per my logic, I am terminating the loop at i= 4 because of short circuit due to OR operation. Please let me know if this approach is correct or I am missing out on something.
tishhaagrawal
411
views
tishhaagrawal
asked
Nov 22, 2023
Programming in C
programming-in-c
gate-preparation
made-easy-test-series
test-series
+
–
1
votes
1
answer
44
3 Dimensional Array
How is the address written for 3-dimensional arrays? In some answers, I saw (row, column, frame) and in others, it was (frame, row, column) Which one to follow?? Also, how are these arrays stored in the memory?? Please answer
How is the address written for 3-dimensional arrays?In some answers, I saw (row, column, frame) and in others, it was (frame, row, column) Which one to follow??Also, how ...
amitarp818
422
views
amitarp818
asked
Oct 25, 2023
Programming in C
programming-in-c
array
+
–
Page:
« prev
1
2
3
4
5
6
7
...
64
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register