
2nd Round Coding
Quiz
•
•
Practice Problem
•
Hard
Syed Raja
Used 1+ times
FREE Resource
Enhance your content in a minute
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
3 mins • 5 pts
1.
1.Point out the error in the following program
#include<stdio.h>
int main()
{
display();
return 0;
}
void display()
{
printf("Hello");
}
a. No error
b. display() doesn't get invoked
c.
display() is called before it is defined
d.
None of these
2.
MULTIPLE CHOICE QUESTION
3 mins • 5 pts
2.Which of the following statements are correct about the below declarations?
char *p = "Sanjay";
char a[] = "Sanjay";
1:There is no difference in the declarations and both serve the same purpose.2:p is a non-const pointer pointing to a non-const string, whereas a is a const pointer pointing to a non-const pointer.3:The pointer p can be modified to point to another string, whereas the individual characters within array a can be changed.4:In both cases the '\0' will be added at the end of the string "Sanjay".
a. 1, 2
b. 2, 3, 4
c. 3, 4
d. 2, 3
3.
MULTIPLE CHOICE QUESTION
3 mins • 5 pts
3.Point out the error in the program?
#include<stdio.h>
int main()
{
char ch;
int i;
scanf("%c", &i);
scanf("%d", &ch);
printf("%c %d", ch, i);
return 0;
}
3.Point out the error in the program?
#include<stdio.h>
int main()
{
char ch;
int i;
scanf("%c", &i);
scanf("%d", &ch);
printf("%c %d", ch, i);
return 0;
}
a. Error: suspicious char to in conversion in scanf()
b. Error: we may not get input for second scanf() statement
c. No error
d. None of above
4.
MULTIPLE CHOICE QUESTION
3 mins • 5 pts
4.Point out the error in the program
#include<stdio.h>
int main()
{
int a=10;
void f();
a = f();
printf("%d\n", a);
return 0;
}
void f()
{
printf("Hi");
}
a. Error: Not allowed assignment
b. Error: Doesn't print anything
c. No error
d.None of above
5.
MULTIPLE CHOICE QUESTION
3 mins • 5 pts
5.Point out the error in the program?
#include<stdio.h>
int main()
{
struct emp {
char name[20];
float sal; };
struct emp e[10];
int i;
for(i=0; i<=9; i++)
scanf("%s %f", e[i].name, &e[i].sal);
return 0;
}
a. Error: invalid structure member
b. Error: Floating point formats not linked
c. No error
d. None of above
Similar Resources on Wayground
10 questions
TIN 11 - PYTHON - PHÉP TOÁN - BIỂU THỨC - CÂU LỆNH GÁN
Quiz
•
11th Grade
10 questions
Start game 8
Quiz
•
8th Grade
10 questions
Aplicación justa de las leyes
Quiz
•
5th Grade
10 questions
Day 15 Assessment -Encapsulation & Abstraction, Exception-28June
Quiz
•
University
10 questions
Các kiểu dữ liệu - câu lệnh vào ra đơn giản
Quiz
•
KG
10 questions
GAME 6
Quiz
•
KG - University
10 questions
EL FENÓMENO DEL CONOCIMIENTO
Quiz
•
10th Grade
10 questions
TEST FINAL DEPRESIÓN
Quiz
•
University
Popular Resources on Wayground
10 questions
Forest Self-Management
Lesson
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
30 questions
Thanksgiving Trivia
Quiz
•
9th - 12th Grade
30 questions
Thanksgiving Trivia
Quiz
•
6th Grade
11 questions
Would You Rather - Thanksgiving
Lesson
•
KG - 12th Grade
48 questions
The Eagle Way
Quiz
•
6th Grade
10 questions
Identifying equations
Quiz
•
KG - University
10 questions
Thanksgiving
Lesson
•
5th - 7th Grade
Discover more resources for
10 questions
Forest Self-Management
Lesson
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
30 questions
Thanksgiving Trivia
Quiz
•
9th - 12th Grade
30 questions
Thanksgiving Trivia
Quiz
•
6th Grade
11 questions
Would You Rather - Thanksgiving
Lesson
•
KG - 12th Grade
48 questions
The Eagle Way
Quiz
•
6th Grade
10 questions
Identifying equations
Quiz
•
KG - University
10 questions
Thanksgiving
Lesson
•
5th - 7th Grade
