Array in C

Quiz
•
Computers
•
University
•
Hard
Bhanu Pratap Rai
Used 412+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
How do you initialize an array in C?
int arr[3] = (1,2,3);
int arr(3) = {1,2,3};
int arr[3] = {1,2,3}
int arr(3) = (1,2,3)
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of C Program.?
int main()
{
int a[] = {1,2,3,4};
int b[4] = {5,6,7,8};
printf("%d,%d", a[0], b[0]);
}
1
2
4
Error
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of C Program.?
int main() {
int a[] = {1,2,3,4};
int b[4] = {5,6,7,8};
printf("%d,%d", a[0], b[0]);
}
1,5
2,6
0,0
Error
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of C Program.?
int main()
{
char grade[] = {'A','B','C'}; printf("GRADE=%c, ", *grade); printf("GRADE=%d", grade);
}
GRADE=some address of array, GRADE=A
GRADE=A, GRADE=some address of array
GRADE=A, GRADE=A
Compiler error
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of C program.?
int main() {
char grade[] = {'A','B','C'}; printf("GRADE=%d, ", *grade); printf("GRADE=%d", grade[0]);
}
A A
65 A
65 65
None
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of C program.?
int main()
{
float marks[3] = {90.5, 92.5, 96.5};
int a=0;
while(a<3)
{
printf("%.2f,", marks[a]); a++;
}
}
90.5 92.5 96.5
90.50 92.50 96.50
0.00 0.00 0.00
Compiler error
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of C Program.?
int main() {
int a[3] = {10,12,14};
a[1]=20;
int i=0;
while(i<3)
{ printf("%d ", a[i]);
i++; }
}
20 12 14
10 20 14
10 12 20
Error
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
CIS1101-programming practice

Quiz
•
University
9 questions
IPC144 SLG -- Week2

Quiz
•
University
10 questions
Basics Of C Programming

Quiz
•
University
10 questions
Basics of C

Quiz
•
University
10 questions
C - Pointers

Quiz
•
University
10 questions
C Program Array and strings

Quiz
•
University
15 questions
Coding club Summit Online Quiz

Quiz
•
University
10 questions
Arrays in C (II yr 02.07.2020)

Quiz
•
University
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade