Quiz 01 Sol

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

GHULAM ISHAQ KHAN INSTITUTE OF ENGINEERING SCIENCES AND TECHNOLOGY

Materials Engineering Manufacturing (MTM)


F Introduction to Computing and Programming (CS101) (Fall 2021)

Name __________________ Reg No.______________ Marks (15)


Quiz # 1 Semester (1 st) Date: 26-Oct-2021 Time allotted: 15
Mins

Q1. Choose the correct answer. Note that overwriting is not allowed [5]

1. Which of the following includes in System Software: b

(a) Word Processors (b) Operating System (c) Games

2. Each cell has a unique location in main memory, called the ----------------- of the cell. c

(a) Data (b) Instruction (c) Address

3. Which of the following is a pre-processor directive: a

(a) #include<iostream> (b) main() (c) cout (d) using namespace std;

4. Which of the following step is used to combine object program with other programs provided by the
SDK to create executable code: a

(a) Linker (b) Loader (c) Compiler (d) Preprocessor

5. Which of the following is a correct comment? c

(a) */ Comments */ (b) ** Comment **


(c) /* Comment */ (d) { Comment }

~~~~~~~~~~~~~~~~~~~~~~ There are no shortcuts to success ~~~~~~~~~~~~~~~~~~~~~


GHULAM ISHAQ KHAN INSTITUTE OF ENGINEERING SCIENCES AND TECHNOLOGY
Materials Engineering Manufacturing (MTM)
F Introduction to Computing and Programming (CS101) (Fall 2021)

Name __________________ Reg No.______________ Marks (15)


Quiz # 1 Semester (1 st) Date: 26-Oct-2021 Time allotted: 15
Mins

Q2. Write down Output of following set of Code; identify the error if any and suggest the
correction needed: [5]
Set 1:

#include <iostream>

using namespace std;

int main ()

{ Error is there.

cout << "Hello World! Solution: cout << "Hello World! \

I'm a C++ program "; I'm a C++ program ";


return 0;

Set 2:

#include <iostream>

using namespace std;

int main ()

int var;

var = 10;

cout<<var;

cout<<"Welcome\nto\n\n C++!"<<endl;

return 0;

~~~~~~~~~~~~~~~~~~~~~~ There are no shortcuts to success ~~~~~~~~~~~~~~~~~~~~~


GHULAM ISHAQ KHAN INSTITUTE OF ENGINEERING SCIENCES AND TECHNOLOGY
Materials Engineering Manufacturing (MTM)
F Introduction to Computing and Programming (CS101) (Fall 2021)

Name __________________ Reg No.______________ Marks (15)


Quiz # 1 Semester (1 st) Date: 26-Oct-2021 Time allotted: 15
Mins

~~~~~~~~~~~~~~~~~~~~~~ There are no shortcuts to success ~~~~~~~~~~~~~~~~~~~~~

You might also like