
kamala_bec
Authored by kamala patil
Computers
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
#include<stdio.h>
struct Point{
int x, y, z;};
int main(){
struct Point p1 = {.y = 0, .z = 1, .x = 2};
printf("%d %d %d", p1.x, p1.y, p1.z);
return 0;}
compiler error
2 0 1
0 1 2
2 1 0
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct Test
{
char str[20];
};
int main()
{
struct Test st1, st2;
strcpy(st1.str, "GeeksQuiz");
st2 = st1;
st1.str[0] = 'S';
printf("%s",st2.str);
return 0;
}
SeeksQuiz
compiler error
GeeksQuiz
segmentation fault
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
union test{
int x; char arr[4]; int y;};
int main(){
union test t;
t.x = 0;
t.arr[1] = 'G';
printf("%s", t.arr);
return 0;
}
Predict the output of above program. Assume that the size of an integer is 4 bytes and size of character is 1 byte. Also assume that there is no alignment needed.
a)nothing is printed b) G c)garbage char followed by G followed by more garbage char d)Compiler error
nothing is printed
G
garbage char followed by G followed by more garbage char
Compiler error
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
union test{
int x; char arr[8]; int y;};
int main(){
printf("%d", sizeof(union test));
return 0;}
Predict the output of above program .Assume that the size of an integer and char are 4 and 1 bytes respectively. Also assume that there is no alignment needed
12
16
8
compiler error
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following C declaration
struct{short s[5];union{
float y;long z;}u;}t;
Assume size of short,float,long as 2,4,8 bytes respectively. predict size of t ignoring alignment considerations
22
14
18
10
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
struct node{
int i;float j;};
struct node *s[10];
The above C declaration define ‘s’ to be
an array ,each element of which is a pointer to a structure of type node
structure of 2 fields,each field being a pointer to an array of 10 elements
A structure of 3 fields,an integer,a float,and an array of 10 elements
an array ,each element of which is a structure of type node
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
25 questions
Examen Trimestral de Informática 2°ABCDE
Quiz
•
8th Grade - University
25 questions
SET 2
Quiz
•
University
25 questions
Neo Coding Round 1 Set 3
Quiz
•
University
30 questions
Generation of programming languages and language processors
Quiz
•
University
27 questions
Software Engineering
Quiz
•
University
25 questions
Quiz Koding dan AI
Quiz
•
10th Grade - University
25 questions
¿Sabes más que un estudiante de avanzada? 2023-1
Quiz
•
University
25 questions
Hardware Y Conectividad De Equipos Personales Capitulo 4
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
29 questions
Alg. 1 Section 5.1 Coordinate Plane
Quiz
•
9th Grade
22 questions
fractions
Quiz
•
3rd Grade
11 questions
FOREST Effective communication
Lesson
•
KG
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Computers
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
7 questions
Fragments, Run-ons, and Complete Sentences
Interactive video
•
4th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
10 questions
DNA Structure and Replication: Crash Course Biology
Interactive video
•
11th Grade - University
5 questions
Inherited and Acquired Traits of Animals
Interactive video
•
4th Grade - University
5 questions
Examining Theme
Interactive video
•
4th Grade - University
20 questions
Implicit vs. Explicit
Quiz
•
6th Grade - University
7 questions
Comparing Fractions
Interactive video
•
1st Grade - University