0% found this document useful (0 votes)
8 views2 pages

Class Quiz # 3 PF

Mom
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Class Quiz # 3 PF

Mom
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Class Quiz # 03 Programming Fundamentals

Course Name Programming Course Code CS-2115|11


Fundamentals
Course Instructor: Shakeel Waris Program Name BS Software Eng.

Semester BSSE Section U+V

Submission Deadline 14 May, 2024, 11:59 PM Maximum Marks 05

1. An inline function is expanded during ______________


a) compile-time
b) run-time
c) never expanded
d) end of the program
2. When we define the default values for a function?
a) When a function is defined
b) When a function is declared
c) When the scope of the function is over
d) When a function is called
3. What will be the output of the following C++ code?

#include<iostream>
using namespace std;

int fun(int x = 0, int y = 0, int z)


{ return (x + y + z); }

int main()
{
cout << fun(10);
return 0;
}
a) 10
b) 0
c) Error
d) Segmentation fault
4. Which of the following is important in a function?
a) Return type
b) Function name
c) Both return type and function name
d) The return type, function name and parameter list
5. Which of the following correctly declares an array?
a) int array[10];
b) int array;
c) array{10};
d) array array[10];
6. What will be the output of the following C++ code?

#include <stdio.h>
#include <iostream>
using namespace std;
int main()
{
char str[5] = "ABC";
cout << str[3];
cout << str;
return 0;
}

a) ABC
b) ABCD
c) AB
d) AC

7. What is the index number of the last element of an array with 9 elements?
a) 9
b) 8
c) 0
d) Programmer-defined

8. The data elements in the structure are also known as what?


a) objects
b) members
c) data
d) objects & data

9. What will happen when the structure is declared?


a) it will not allocate any memory
b) it will allocate the memory
c) it will be declared and initialized
d) it will be declared

10. The declaration of the structure is also called as?


a) structure creator
b) structure signifier
c) structure specifier
d) structure creator & signifier

You might also like