
C-structures , bitfields,union and File Handling

Quiz
•
Professional Development
•
University
•
Hard
Shaik Imam
Used 3+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Can the following C code be compiled successfully?
#include <stdio.h>
struct p
{
int k;
char c;
float f;
};
int main()
{
struct p x = {.c = 97, .f = 3, .k = 1};
printf("%f\n", x.f);
}
Depends on the standard
No
Depends on the platform
Yes
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C code?
#include <stdio.h>
struct student
{
int no;
char name[20];
};
void main()
{
student s;
s.no = 8;
printf("%d",s.no);
}
Nothing
8
Compile time error
Junk
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What would be the size of the following union declaration? (Assuming size of double = 8, size of int = 4, size of char = 1)
#include <stdio.h>
union uTemp
{
double a;
int b[10];
char c;
}u;
4
8
40
80
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C code
#include <stdio.h>
union temp
{
int a;
float b;
char c;
};
int main()
{
union temp s = {1,2.5,’A’};
printf("%c",s.c);
return 0;
}
'1'
Compilation error
'A'
Nothing
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C code? (Assuming size of char = 1, int = 4, double = 8)
#include <stdio.h>
union utemp
{
int a;
double b;
char c;
}u;
int main()
{
u.c = 'A';
u.a = 1;
printf("%zu", sizeof(u));
}
8
4
1
13
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of this program?
#include <stdio.h>
int main()
{
typedef struct tag {
char str[10];
int a;
} tag;
tag h1, h2 = { "IHelp", 10 };
h1 = h2;
h1.str[1] = 'h';
printf("%s, %d", h1.str, h1.a);
return 0;
}
Error
IHelp 10
Ihelp 10
No Error ,No output
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of this program?
#include <stdio.h>
int main()
{
union test {
int i;
int j;
};
union test var = 10;
printf("%d, %d\n", var.i, var.j);
}
10,10
garbage values
Nothing
Compilation Error
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Sensors and Instrumentation- Pre-Requisite

Quiz
•
University
20 questions
1er Examen de Estadística II a

Quiz
•
University - Professi...
15 questions
Exploring C# Arrays and For Statements

Quiz
•
University
15 questions
Programming - Screening Test

Quiz
•
3rd Grade - Professio...
17 questions
Monitoreo y Control Parcial 1

Quiz
•
University
25 questions
Python-101

Quiz
•
University
24 questions
COMPLEXIVO PARTE 7

Quiz
•
University
25 questions
Final Assessment C & C++ & DSA - 2nd August 24

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Professional Development
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University