Computer-2nd Year Guess Paper
Computer-2nd Year Guess Paper
COMPUTER 2 nd Year
OBJECTIVE
Q.No.1
(1) The case block ends with:
(a) end select (b) end case (c) break (d) case else
(2) Every c program must have:
(A) Scanf function (b) Getche function (c) Main function (d) Print function
(3) The escape sequence for new line:
(A) \ n (b) \t (c) \b (d) \f
(4) Turbo C++ can compile:
(a) assembly program (b) C++ program only (c) machine program (d) c & c++ program
(5) A loop within a loop is a called:
(a) double loop (b) dual loop (c) complete loop (d) nested loop
(6) The output of compiler is called:
(a) library code (b) source code (c) linked code (d) object code
(7) Function prototype for build in functions are specified in:
(a) source file (b) object file (c) header file (d) image file
(8) Void occupy how many bytes in memory?
(a) zero (b) one (c) two (d) four
(9) Variables are created in:
(a) rom (b) cache (c) ram (d) hard disk
(10) Which part of loop executed only one:
(a) condition (b) Increment (c) initialization (d) decrement
(11) Which is a valid character constant?
(a) A (b) ‘ Hello ’’ (c) ‘6’ (d) =
(12) Which programming structure executes program statement in – order?
(a) sequence (b) repetition (c) decision (d) relation
(13) The condition operator is an alternative of:
(a) If (b) if – else (c) nested – if (d) none
(14) This statement is to cause a loop to terminate early:
(a) break (b) terminate (c) exit (d) end
(15) A special value that makes the end of a list of input data is called:
(a) terminal value (b) sentinel value (c) loop control value (d) input value
SUBJECTIVE
1. State the purpose of defining per-processor directive.
2. What do you mean by delimiters?
3. What do you mean by machine independence?
4. What is the purpose of linker in C language?
5. Trace Errors
char ch1 = a
char ch2 = b
STARS COLLEGE OF SCIENCE & COMMERCE
FOR GIRLS MULTAN CAMPUS
(ch1 ≠ ch2)
6. Differentiate b/w pre – processor directive and header file.
7. Why the logical error is the most difficult error?
8. What is the use of main ( ) function in C?
9. How program logic implemented in structured programming language and why it is error prone?
10. Write any two rules for naming a variable.
11. Differentiate between declaring and deleting a variable.
12. Trace the error
Int a = 6
++a;
printf (“ % f ’, a)
13. Trace the output
float a = -17.245;
printf (“ % 8.3f ” , a);
14. Trace error from the following
# include < stdio.h >;
Void main ( )
{
int x = 5
10 + 5 = x;
15. How string value displayed in C language?
16. Describe the use of comment in C language.
17. How executable file is created?
18. Write the use of printf function write its syntax.
19. Define standard output.
20. Trace the output
Void main ( )
{
printf (“55/t” );
printf (“666”);
printf (“ /n 777”);
}
21. Predict the output
int price = 10;
if (price! = 10;
price = 0;
else
price * = 20;
printf (“%d” , price);
22. Describe sentinel loop.
23. Trace the output
STARS COLLEGE OF SCIENCE & COMMERCE
FOR GIRLS MULTAN CAMPUS
Int k;
for (k = 0 ; k < = 5 ; k + = 4)
printf (“% d” , k);
24. Why a default Label used in switch statement?
25. Define compound statement and write its example.
26. Predict the output of the following code
int a = 9;
if (a%2 = = 0)
printf (“Even”);
else
printf (“odd”);
27. Differentiate between if – else & switch statement.
28. What is Compiler.
29. What is garbage value?
30. List any four types of integer data in C language.
31. What is relational operator?
32. Trace the error
#include<stdio.h>
Void main()
{
Printf(“High Programming Language”)
}
33. Trace the output of the following:
x=5;
y=x++;
printf(“%d%d”,x,y);
34. What are the advantages of C Language.
35. What is the use of printf() function?
36. Define Conditional loop.
37. Discuss the role of \b.
38. What is variable deceleration.
39. How Interpreter works?
40. What happens if break is missed in case block?
41. What is format specifier?
42. Determine the output
If(1 == 2)
printf(“PUNJAB”);
else
printf(“KPK”);
43. Define the term machine independence.
44. Why the logical error is most difficult error
45. Differentiate b/w String constant and character Constant?
46. What is identifier? Give an example
47. Define Compound assignment statement.
48. Write down output of the following:
if (2 % 3 > = 1)
printf(“good”);
else
printf(“bad”);
49. What is language processor?
50. Define preprocessor directive and write tis two uses.
51. Define syntax error with example.
52. Differentiate between linker and loader.
STARS COLLEGE OF SCIENCE & COMMERCE
FOR GIRLS MULTAN CAMPUS
53. What is the use of turbo C++ ?
54. How the program logic is implemented in structured programming language?
55. Define standard identifier and give some examples.
56. Define keyword with example.
57. Write the use of operators.
58. Initialize three variables T1, T2, T3 in a single line by assigning values 48, 45 and 39 respectively.
59. What is arithmetic expression?
60. Define compound assignment statement.
61. Wha is the output of: printf(“%C”, 67);
62. Pedict the output
int x = 7;
int y = 3;
printf (“%d and %d, x y , x%y);
63. Determine output -0.007 %8.5f
64. Describe format specifier.
65. Why is c strongly typed language?
66. Define while loop.
67. Predict the output:
int a=1,b=5;
if((a+b)<6)
printf (“%d”,b);
printf (“%d”,a+b);
int i;
for(i=3;i<=39;i+=6)
printf(“%d\n”,i)
int n=10;
(x%2==0? printf(“even”):printf(“odd”))
LONG
1. Write some advantages or characteristics of C language.
2. Explain nested – If statement with its purpose, syntax, flowchart & suitable program example.
3. What is type casting & explain its types with an example.
4. Write a program to print odd numbers from 11 to 30 using loop.
5. Write a program that input a number and display the table of that number.
6. What is control structure? Briefly Describe the basic control structure for writing programs.
7. Briefly describe the basic structure of C program.
Write a C program in C Language to accept a year from the user. Find out it is a leap year or not leap year.
STARS COLLEGE OF SCIENCE & COMMERCE
FOR GIRLS MULTAN CAMPUS
What is while loop? Explain the working of while loop structure with example also and give its
syntax and flow chart.
8. Describe the characteristics of high-level programming language.
9. Describe decrement operator in detail along with example.
10. Write a program that input three numbers and display the maximum number by using nested if
statement
11. What is for loop? Write its syntax and working of for loop with example
12. What is database design? Briefly explain the database design process with the help of diagram
13. Define file. Explain the file types from usage point of view.
14. What is control structure? Briefly Describe the basic control structure for writing programs.
15. Briefly describe the basic structure of C program.
16. Write a C program in C Language to accept a year from the user. Find out it is a leap year or not leap year.
17. What is while loop? Explain the working of while loop structure with example also and give its
syntax and flow chart.
MS-ACCESS (ATTEMPT ANY ONE QUESTION)
18. What is file traditional processing system? Write down its disadvantages in detail.
19. When is a relation in first normal form? Explain with example.
C-LANGUAGE (ATTEMPT ANY TWO QUESTION)
20. What is switch statement? Explain its working with flowchart and example.
21. Write a program in C-language which does display the sum of following series using any loop.
1 1 1 1
1 + + + + ......... +
2 4 6 100
22. Briefly describe the process of writing a function in C-language.