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
Recent questions tagged goclasses_wq8
6
votes
1
answer
1
GO Classes 2023 | Weekly Quiz 8 | Question: 1
What will be the output of the following program? struct s{ int i; struct s *p; }; struct s arr[4] = { 7, arr+3, 8, arr+2, 9, arr, 8, arr+1, }; struct s *ap[] = {arr+3, arr+2, arr+1, arr}; struct s **pp =ap; int main() { printf("%d ", ... +->i); printf("%d", ++arr[2].p->i); } $9\; 10\; 9$ $7 \;8\; 10$ $7\; 8\; 9$ None of these
GO Classes
asked
in
Programming
Apr 21, 2022
by
GO Classes
432
views
goclasses_wq8
goclasses
programming
programming-in-c
structure
2-marks
4
votes
1
answer
2
GO Classes 2023 | Weekly Quiz 8 | Question: 2
Consider below four program fragments. Which of the program(s) is/are likely to produce run time error or memory leak. Assume malloc is always successful, and sizes are as follows - sizeof(int *) = 8 bytes sizeof(double) = 8 bytes sizeof(char) = 1 byte sizeof( ... ] = %d\n", a[0], a[1]); return 0; } Program $1$ Program $2$ Program $3$ Program $4$
GO Classes
asked
in
Programming
Apr 21, 2022
by
GO Classes
554
views
goclasses_wq8
goclasses
programming
programming-in-c
multiple-selects
2-marks
2
votes
2
answers
3
GO Classes 2023 | Weekly Quiz 8 | Question: 3
#include <stdio.h> int main() { int i= 255; short int *s= (short int *)&i; printf("%d\n", *s); } What will be the output of the above program in little-endian and big-endian, respectively? $(65280\text{ is } 255\times2^8)$ $255,\; 0$ $65280,\; 0$ $0,\;0$ $0,\; 65280$
GO Classes
asked
in
Programming
Apr 21, 2022
by
GO Classes
323
views
goclasses_wq8
goclasses
programming
programming-in-c
output
2-marks
3
votes
2
answers
4
GO Classes 2023 | Weekly Quiz 8 | Question: 4
Consider the following declaration of $a$. int a[100][200][30]; What will be the integer value of $a[50][300] - a[10][500]$?
GO Classes
asked
in
Programming
Apr 21, 2022
by
GO Classes
450
views
goclasses_wq8
goclasses
programming
programming-in-c
array
numerical-answers
2-marks
3
votes
1
answer
5
GO Classes 2023 | Weekly Quiz 8 | Question: 5
Consider the following declaration of struct. struct myst{ char a[20]; char *b; struct myst *p; }x[2] = {"GATE", "Overflow", x+1, "GO", "Classes", x}, *p = x; What will be the output of the following print statement? printf("%s", p++->p->b++); Overflow Classes verflow lasses
GO Classes
asked
in
Programming
Apr 21, 2022
by
GO Classes
425
views
goclasses_wq8
goclasses
programming
programming-in-c
structure
1-mark
2
votes
2
answers
6
GO Classes 2023 | Weekly Quiz 8 | Question: 6
What will be the output of the following program? #include<stdio.h> struct _myst{ char b[20]; char *a; struct _myst *c; }x[2] = {"GATE", "Overflow", x+1, "GO", "Classes", x}, *p = x; typedef ... -1); } int main() { printf("%s",mystry(p,2023)->a); } GATE Overflow Run time error Compile-time error
GO Classes
asked
in
Programming
Apr 21, 2022
by
GO Classes
345
views
goclasses_wq8
goclasses
programming
programming-in-c
structure
2-marks
3
votes
1
answer
7
GO Classes 2023 | Weekly Quiz 8 | Question: 7
What will be the output of the following program? struct s{ int i; struct s *p; }; struct s arr[4] = { 7, arr+3, 8, arr+2, 9, arr, 10, arr+1, }; struct s *ap[] = {arr+3, arr+2, arr+1, arr}; struct s **pp =ap; int main() { printf("%d", ap[pp[0]->p->i%2]->i++); } $7$ $10$ $9$ $8$
GO Classes
asked
in
Programming
Apr 21, 2022
by
GO Classes
184
views
goclasses_wq8
goclasses
programming
programming-in-c
structure
output
2-marks
3
votes
1
answer
8
GO Classes 2023 | Weekly Quiz 8 | Question: 8
Based on the struct alignment discussed in class, What are the sizes of $\textsf{foo1, foo2, foo3}$ and $\textsf{foo4}$ respectively? Sizes of primitive data types are given below. sizeof(int) = 4 bytes sizeof(short) = 2 bytes sizeof(char) = 1 byte struct foo1 { int d1; char c1; ... $9,\; 12,\;16,\; 20$ $12,\; 16,\; 12,\; 20$ $12,\; 20,\; 20,\; 20$
GO Classes
asked
in
Programming
Apr 21, 2022
by
GO Classes
310
views
goclasses_wq8
goclasses
programming
programming-in-c
structure
2-marks
4
votes
2
answers
9
GO Classes 2023 | Weekly Quiz 8 | Question: 9
Assume that an int variable takes $4$ bytes and a char variable takes $1$ byte. What is the output of the code below? int main() { int arr[]={10,20,30,40,50,60}; int *ptr1=arr; int *ptr2=arr+5; printf("Number of ... pointers are: $20$ Number of elements between two pointer are: $5.$ Number of bytes between two pointers are: $5$ Compile time error
GO Classes
asked
in
Programming
Apr 21, 2022
by
GO Classes
347
views
goclasses_wq8
goclasses
programming
programming-in-c
pointers
array-of-pointers
1-mark
6
votes
1
answer
10
GO Classes 2023 | Weekly Quiz 8 | Question: 10
Mark all options which are likely to create problems with memory, i.e., run time error or has a memory leak. Assume that malloc is successful in all cases. Program 1: int *p = malloc(sizeof(int)); *p = 0; free(p); *p = 0; Program2: int *p = ... free(p); Program 4: int *p = malloc(sizeof(char)); *p = 0; Program $1$ Program $2$ Program $3$ Program $4$
GO Classes
asked
in
Programming
Apr 21, 2022
by
GO Classes
286
views
goclasses_wq8
goclasses
programming
programming-in-c
multiple-selects
2-marks
To see more, click for the
full list of questions
or
popular tags
.
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
DRDO Scientist -B
ISRO Scientist-B 2023
BARC RECRUITMENT 2023
COAP Responses | GATE CSE 2023
Interview Experience : M.Tech AI at IIT Jodhpur, Self Sponsored
Subjects
All categories
General Aptitude
(2.8k)
Engineering Mathematics
(9.7k)
Digital Logic
(3.4k)
Programming and DS
(5.9k)
Algorithms
(4.6k)
Theory of Computation
(6.7k)
Compiler Design
(2.3k)
Operating System
(5.0k)
Databases
(4.6k)
CO and Architecture
(3.8k)
Computer Networks
(4.7k)
Non GATE
(1.4k)
Others
(2.4k)
Admissions
(665)
Exam Queries
(1.0k)
Tier 1 Placement Questions
(17)
Job Queries
(77)
Projects
(9)
Unknown Category
(867)
Recent questions tagged goclasses_wq8
Recent Blog Comments
Indeed the reasons are valid, hope the positive...
@Shubham Sharma 2 Is it possible to get a...
are MSc.(CS) students eligible?
It is said that the gate score will have 80%...
Maybe we should raise our concern in Supreme...