Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

CS201 Current MID Term Papers Fall 2012 Date: 08-December-2012 to 19-December-2012

Views: 3343

Replies to This Discussion

Current Midterm Solved paper 2012

Attachments:

Muhammad Afzal thanks for sharing to help other 

Note for All Members: You don’t need to go any other site for current Mid Term papers fall 2012, Because All discussed data/sharing of our members in this discussion are going from here to other sites. You can judge this at other sites yourself. So don’t waste your precious time with different links.

 

so nice of you. thank you alot for helping in preparation dear

considering the following structure write the code for initializing the structure and then display the value 

of each variable (5)

structure student{

char name[64];

char course[128];

int age;

int years; 

};

quiz of 5 marks

determin the value of m and n after the execution of code given below

int m=44;

int*p=&m;

int&r=m;

int n=(*p)++

int*q=p-q;

++*q;

assume the integer occupies 4 byte and then m is stored in memory

what will b he output of the given program code?

#include<iostream.h>

main()

{int num[3][2]={12,51,34,54,14,55};

for(int j=0;j<3;j++)

cout*(*(num+j)+1)endle;

return0;

}

question of 3 marks kuch codyehi tha lakin poocha kia ye nhi likh ski 

while (! infile.eof())

{

int file>>name>>sal>>dept;

coutname"\t",,sal"\t"dept"\t"endle;

}

 

CS201 MID TERM Current Papers Dec.-2012 Fall 

Cs 201 current paper :

20 mcqs and 2 3 question of 2 marks 2 question of 3 marks ,2 question of 5 marks 

Q.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.

Q.Identify the errors in the following code segment and give the reason of errors
main(){
int x = 10
const int *ptr = &x ;
*ptr = 5 ;
}
Q. Write the syntax of outfile.text ?
Q Advantage of close() file

CS201 MID TERM Current Papers Dec.-2012 Fall 

Cs 201 current paper :

20 mcqs and 2 3 question of 2 marks 2 question of 3 marks ,2 question of 5 marks 

Q.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.

Q.Identify the errors in the following code segment and give the reason of errors
main(){
int x = 10
const int *ptr = &x ;
*ptr = 5 ;
}
Q. Write the syntax of outfile.text ?
Q Advantage of close() file

Bits Manipulations programs of Lecture 21

Attachments:

A pogrom from midterm exam

  1. Which one is correct initializing of 2D array having 3 rows and 2 cols
    1. int arr[2][3] = {6,7,4}
    2. int arr[3][2] = {5,6,7}
    3. int arr[3][2] = {2}
    4. int arr[][2] = {(2,3),(4,5),(5,2)}
  2.  a loop which is used for known repetition
    1. For loop
    2. While loop
    3. Do while loop
    4. Switch
  3. If x = 10 and y = 5 then x %= y*3…………..
    1. 10
    2. 15
    3. 30
    4. 0
  4. The size of int data type in memory
    1. 1 byte
    2. 1 bit
    3. 8 byte
    4. 4 byte
  5. For which array type one more than size array declared
    1. Int
    2. Double
    3. Char
    4. None
  6. If x = 7 then x %= 2 …………
    1. 3
    2. 2
    3. 1
    4. 0
  7. Which symbol in represent process in flow chart
    1. Oval
    2. Rectangle
    3. Square
    4. None
  8. Correct statement to assign zero all the elements
    1. Arr[2][3] = {0,0}
    2. Arr[2][3] = {{0},{0}}
    3. Arr{2][3] = {0}
    4. None
  9. Array is a data structure that stores…………….
    1. Memory address
    2. Variables
    3. Data types
    4. Values
  10. ……………………….. of a function is also called signature of a function
    1. Declaration
    2. Definition
    3. 2 op bhool geya
  11. A function which does not return any value has return type
    1. Int
    2. Void
    3. Char
    4. None
  12. C provides standard language in (isi tara ka tha kuch)
    1. 1960
    2. 1987
    3. 1986
    4. 1992
  13. Compiler of c is written in………………..
    1. Java
    2. Fortron
    3. C
    4. Pata nai keya tha
  14. C  developed in………………..
    1. Richard laboratory
    2. Bell laboratory
    3. Microsoft
    4. IBM
  15. Information stored in computer  memory
    1. Volatile
    2. Permanent
    3. Non-volatile
    4. Bhool geya
  16. Question e bhool geya
  17. C++ views each file as sequential stream of
    1. Bits
    2. Bytes
    3. Names
    4. Words
  18. Bhool geya
  19. Bhool geya
  20. Record is a group of related
    1. Fields
    2. Bytes
    3. Files
    4. Words
  21. Find the error in following code and describe in detail

#include<iostream.h>

Main()

{

                int x = 10;

                int y = 5;

               

                int *const ptr = &x;

                ptr = &y

                return 0;

}

  1. Left shift the string 0101 and write the  answer in binary and decimal
  2. What happened if file “write.txt” does not exist. And we open file as Infile.open(“write.txt”,ios::in)
  3. Write a program and open a file “out.txt” and move 100 bytes  from begning and write

“Reached at position 101”

  1. Write constant pointer to integer

And pointer to constant integer

  1. Ik aur question tha jis main b error hi dhoondna tha wo yad nai a rha

26 QUESTIONS

20 MCQ'S 

1) TWAIN stands for........ (Ans:Technology without any interesting name)

2) microsoft word is what type of software.......(utility,driver,application)
3) First address of an element in array is called....? (first address, base address)
4) Doc file (Ms word file) is of what kind (a binary acces file, random access file, sequential or exe)
5) switch statement is replacement of ( Ans: multiple-if statement)
6) which statement checks the test condition at the end of loop (Ans: while)

7)mcq about checking of file through tg() tp()...etc

which bit of the number gives sign. (2)
how clossing a program with close() funciton saves memory(5)

suggestion: Grasp over the arrays and pointers and you've completed 80 percent of the paper.....:)



Read more: CS201 Midterm paper (11-12-2012) - Virtual University of Pakistan http://vustudents.ning.com/group/cs201introductiontoprogramming/for...

3. What a problem in the given code. How can you correct it.

Cout”p=”p”,p+q=”p+qend1;                          Marks(2)

 4. what is error in this code and give reason of error.

main()

{

                  Intx=10;

                  Const int *ptr=&x;

*ptr = 5;

      }                                                                                   Marks(3)

Sequential and random method. In given 2 method wich one is best and why?

                                                                                          Marks(3)

  1. write a programe that prompt the user to enter the value in an array

programe should sort the array in increasing order and found the maximum and minimum number in the array.                                            Marks(5)

 

6.  write a programme which create a new file having name cs201.txt and write introduction to programming taught by Dr Naveed Malik” in it.

      And after that print the content of this text file an the screen using getline function.

                                                                                                                        Marks(5)



RSS

Looking For Something? Search Below

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service