We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

CS201 Current Midterm papers Dated 11-05-2012 to 22-05-2012

CS201 Current Midterm papers Dated 11-05-2012 to 22-05-2012

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

Views: 3112

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

Replies to This Discussion

my today's paper

1. Write a declaration statement for an array of 10 elements of type float. Also initialize first four elements of array to 1.0, 2.0, 3.0 and 4.0.(2)
2. Which bitwise operator returns true if both bits are different and returns false if both bits are same?(2)
3. Suppose if we want to store values like 10, 45.3, 4, A, D, 6.4, and 50 by using array. Can we store all these elements by declaring a single array? Yes or no ? Give reason to support your answer(3)
4. Write the code for a structure called Inventory having the following elements:

A character array named partName

An integer named partNumber

An integer named stock. (3)

5.Write a program which opens a file named "this.txt" and then using write() function, writes the string "Introduction to Programming" at the end of the file.(5)

6.Write a program which declares and initializes an integer array of 10 elements and then using a pointer, displays the array elements in reverse order.

thanks

Mostly mcqs old papers men say thay

5 marks ka ik question tha jis main code likha hua tha aur us code ka logic byan krna tha .

Write the code for a structure called Inventory having the following elements:

• A character array named partName
• An integer named partNumber

An integer named stock.

Declare a 2D array of integers having two rows and three columns.

We know that random method for accessing the files increases the performance but there are certain constrainsts on it. Mention those constraints

Write the code to access the element at third row and second column of a 2D array uses pointer named arrayptr .

C++ views each file as a sequential stream of _______________.

Bytes

Bits

0’s or 1’s

Words

If it is required to copy an array to another array then,

Both arrays must be of the same size and data type

Both arrays may be of different size

Both arrays may be of different data type

Both arrays may be of different size and type

What will be the output of following code?

int x = 10 ;

cout “x =” x ;

10

“x=10”

x=10

10=x

C++ views each file as a sequential stream of________________ .

Bytes

►Bits

►0’s or 1’s

►Words

1 mcqs tha agr semicolon mising ho to kon sa error hoga. Logical,syntc,runtime or compile time

Relational operaters diay huay thay aur pucha gia tha kon say operator hen.

10+6*2/6 ko solve krna tha

thanks

thx

if some one want to get good marks in cs 201

you prepare from LEC no 15 say 22

and mcsq mostly prom past papers

very easy paper tha:

• string conversion k ley kon se header file use hoti hai
• if two programs want to open a file at same time can they open or not?
• TWAIN stands for :
• pointer are used for   ------ store memory address
1. out put btani the 2 questions ke   4 maks
2. two programs of 10 marks

CS201 Paper 11-May-2012 Spring

Don’t remember the exact questions but giving the main theme.
There are
20 MCQ
2x2 Q
3x3 Q
5x5 Q

MCQ most programming base, like what is the syntax or output etc.

Q: tell the sizeof() value of a structure variable.
Q: use of the keyword “const”
Q: which of these functions are string manipulation and conversion function?
Q: a program which input a telephone number with city code and recognize if it is from lhr or not.
Q: an program is given and we have to tell the output. Program consists array and loop.
Q: how many memory locations will a pointer will jump if it is incremented.

CS201 Midterm Examz All Current papers in one thread Spring May 2012

Subject Questions...
Q1. Write a program which will input ten integers into a array then sort it and find maximum and minimum integer in array.
Hint: Finding maximum and minimum is quite easier in sorted array. (10 Marks)
Q2. open() & close() function memory utilization advantages. (3 marks)
Q3. write down a syntax in which we can find the size of structure in bytes. (3 Marks)
Q4. Difference between and (& in pointers. (mark 5)
Q5. int num is an array then assign its address to point myPtr. (Mark 5)

CS201 Midterm Examz All Current papers in one thread Spring May 2012

Shared By Aisha

20 mcqs.mostly from past papers & 15-22 lectures
21) which bit of number is used as a sign bit?
22) open() & close() function advantage of memory utilization..
23) int array[7] is an int array type.what will b the statement for the fourth element of this array?
24 & 25 )write the output of the given code. 5 marks each

CS201 Midterm Examz All Current papers in one thread Spring May 2012

Paper 1:
Total 26 Questions.

Identify each of these functions as character conversion functions or manipulation functions.
1. int isprint( int c )
int tolower( int c )

How can we declare a character array, is it different from integer array declaration? Give one example of character array declaration.
Write the output of following program.
#include<iostream.h>

int main()
{
int a[5] = {5, 1, 15, 20, 25};
int i, j, k, l, m;

i = ++a[1];
j = a[1]++;
k = a[i++];
l = a[i--]*i;
m = a[++i] - 1;

couti" "j" "k " "l" "m;

}

Write the code for a structure called Inventory having the following elements:
• A character array named partName
• An integer named partNumber
• An integer named stock.

Write the code of a main() function which takes command-line arguments and returns an integer type value.

Write a program which defines two strings "Hello" and "Pakistan", merges both the strings using string manipulation function and displays on the screen.

Write the output of following program.
#include<iostream.h>

int main()
{
int a[5] = {5, 1, 15, 20, 25};
int i, j, k, l, m;

i = ++a[1];
j = a[1]++;
k = a[i++];
l = a[i--]*i;
m = a[++i] - 1;

couti" "j" "k " "l" "m;

CS201- Introduction to Programming

11-5-2012 midterm paper on spring 2012

When an array element is passed to a function, it is passed by ----------------.

• ► reference
• data type
• ► value
• ► data

A two-dimensional array has 3 rows and 4 columns. Write down the syntax to initialize first element of all three rows of two-dimensional array with value 2.

Ans:

int matrix[0][0]=2

int matrix[1][0]=2

int matrix[2][0]=2

The size of int data type is

(a) 1 bytes

(b) 2 bytes

(c) 3 bytes

(d) 4 bytes

www.vustudents.ning.com

Pointer is a variable which store,

• Data
• Data Type
• Values

If the file is not properly closed in the program, the program ____________.

(a) _Terminate normally

(b) _Indicate Runtime error

(c) _Indicate Compile time error

(d) _Crashes

In C/C++ language the header file which is used to perform useful task and manipulation of character data is

(a) cplext.h

(b) ctype.h

(c) stdio.h

(d) delay.h

What is the correct syntax to declare an array of size 10 of int data type?

(a) int [10] name ;

(b) name[10] int ;

(c) int name[10] ;

(d) int name[] ;

Long question  (5 marks)

If int array[10]; is an integer array then write the statements which will store values at second, fourth Fifth, seventh and Ninth location of this array,

www.vustudents.ning.com

Which of the following is correct way to initialize a variable x of int type with value

10?

(a) int x ; x = 10 ;

(b) int x = 10 ;

(c) int x, x = 10;

(d) x = 10 ;

If there is more than one statement in the block of a for loop, which of the

following must be placed at the beginning and the ending of the loop block?

(a) parentheses ( )

(b) braces { }

(c) brackets [ ]

(d) arrows < >

What is function of cout ?

(a) To send data to printer

(b) To read data from keyboard

(c) To display message

(d) To display output on the screen

Long question  (5 marks)

Consider memory address 0x22f50 and increment the  int  yptr++ so after increment what is the memory address?

Latest Activity

26 minutes ago
shazi joined + M.Tariq Malik's group

HRM613 Performance Management

1 hour ago
1 hour ago
Hashim Ali added a discussion to the group ECO401 Economics

ECO401 Assignment 1 Solution 2020

1 hour ago
Hashim Ali joined + M.Tariq Malik's group

ECO401 Economics

1 hour ago
Hashim Ali posted discussions
1 hour ago
+ ! ! AɳƓєℓ ❥ liked fahad ali's discussion Final Term Past Papers
2 hours ago
+ ! ! AɳƓєℓ ❥ liked Somaya's discussion Cs401
2 hours ago
+ Drama Queen ! ! ! ! ! ! ! ! ! updated their profile
3 hours ago
3 hours ago
3 hours ago
3 hours ago

1

2

3