2nd Year Important Quesions (2023) PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

AL DEEN SCIENCE & ARTS

ACADEMY

AL DEEN ACADEMY
GHOSIA INSTITUTE OF TECHNOLOGY
ADDRESS : TALAT PARK 30 FT ROAD , LAHORE
Sir Asif Ashiq : 0328-3600060 Sir Saqib Ali : 0326-5864707
AL DEEN SCIENCE & ARTS
ACADEMY

1 Getting Started With C


1) What is programming language ? 2) What are header files ? 3) Define source code ?
4) What is compiler ? 5)Define structure programing language ? 6) Define the term linking .
7) What are logical errors in C and give some examples ? 8) Define statement Terminator ?
9) Differentiate between logical and syntax errors ?
10)What are programming language ? 11)differentiate between Assembly and machine
Language .
12) Why C Language is known as strongly typed language ? 13) What is an Assembler ?
14) Differentiate between Source code and object code ? 15) What is run time error ?
16) Describe the term machine Independence ? 17) What is the use of include directives ?
18) What do you know about C Statement ? 19) Describe Linker and Loader ?

Long Question
1) What necessary steps are taken to prepare a C program for execution? Explain
with diagram .
2) Describe debugging . Explain different types of errors
3) Write some characteristics of C language
4) Define language processor or translator Also discuss different
types of language processors.
5) Describe the characteristics of High Level Language

AL DEEN ACADEMY
GHOSIA INSTITUTE OF TECHNOLOGY
ADDRESS : TALAT PARK 30 FT ROAD , LAHORE
Sir Asif Ashiq : 0328-3600060 Sir Saqib Ali : 0326-5864707
AL DEEN SCIENCE & ARTS
ACADEMY

2 Elements Of C

1) What is type casting and its types ? 2) What are comments in C ?


3) What is keywords in C ? Give examples 4) What is compound statement in C ?
5) What are variables in C 6) What is an identifier ? 7) What is an operator in C
8) What is meant by operator precedence in C 9) Define Assignment operator ?
10) List different types of operator in C 11) What is an Expression ? 12) List two keywords in C
13) Define Assignment statement ? 14) Find the Error int n = 4.2. 15) What is variable Declaration ?

16)Write two difference between constant and variable 17 ) Define identifer ? 18) What is variable initialization ?
19) Write a statement to declare an integer variable i initialized to 10 20) Define field width ?
21) What is increment Operator ? 22) Compound Assignment Operator ?
23) Deermin the output int number = 6 ; printf(“%d/n”,number++);
24) Determine the output printf(“Hello /nWorld/n Pakistan “ );
25) Convert the following conditional expression into if else statement
28) Trac the output
X < 0 ? y = 10 ; z = 20 ;
26) Differentiate between declaring and defining a variable ? Void main(){
27) Trac the output Int a , n , b;
Void main(){ n = 100 ;
P= 3.141593 a = n%100;
Int x , y ; b = n /10;
X = 10 ; n = n%10;
Y = 30 ; printf(“Result = %d%d %d “, n , b , a );
Z=x+y; getch();
printf(“ Result = “,z); }
getch();
}
Long Questions
AL DEEN ACADEMY
GHOSIA INSTITUTE OF TECHNOLOGY
ADDRESS : TALAT PARK 30 FT ROAD , LAHORE
Sir Asif Ashiq : 0328-3600060 Sir Saqib Ali : 0326-5864707
AL DEEN SCIENCE & ARTS
ACADEMY
1) Evaluate the following expressions 2) Explain the following Data types
Int a = 1 , b = 3 , c = 5 , d = 6 ; ( i ) float ( ii ) Double ( iii ) int
Double = x = 1.0 ;
( i ) a > b && c < d ( ii ) a < ! b II !! a
(iii) ( a + b ) * c (iv) c * d / x

1) Write a note on Constant and Comments .


2) What are logical operator ? when are they used ? where do we use logical
expression ? what is the compound statement ?
3) What dose compound assignment statement mean explain with examples
4) Describe the data type String whit examples .
5) What is a variable ? also write rules for naming a variable in C

3 INPUT / OUTPUT

1) What is scan() function in C write its syntax . 2) Define standard Output ?


3) What is control string of printf() function . 4) Write the syntax of printf() Function
5) What is format specifier for string ? 6) What is format specifier? Write example.
8) List some important output function .
7) What is the purpose of using escape sequence ?
10) Define field width specifier in C ?
9) What is the use of Amberadiance ( & ) sign in scanf() ?
12) Differentiate between getch() and getche()
11) List different functions that are used for character function
Input in C ?
13) Differentiate between printf() and scanf() function 14) Define puts() Function
15) Write the syntax of goto statement . 16) What is the use of getch() function .

AL DEEN ACADEMY
GHOSIA INSTITUTE OF TECHNOLOGY
ADDRESS : TALAT PARK 30 FT ROAD , LAHORE
Sir Asif Ashiq : 0328-3600060 Sir Saqib Ali : 0326-5864707
AL DEEN SCIENCE & ARTS
ACADEMY
Long Questions
1) Describe Printf() and scanf() functions in detail

2) Explain the clscr() getch()

3) Write a program in c language that takes 4 numbers As input and display product and
sum of the given numbers

4 Decision Structure
1) What do you mean by selection structure . 2) Which data type is used in “switch” stament’s
expression ?
3) Why should you use default in switch statement ? 4) What are conditional statements ?
5) Define if-else statement 6) What is switch structure ?
7) Define the use of if-statement ? 8) Write syntax of conditional operator ?
9) Define Control Structure ? 10) What do you mean by selection ?
11) Write three advantages of switch statement. 12) What happens if break statement is missed in
case block ?
13) Determine of the following code 14) Trac the output
if( 1 != 2) Void main(){
Int R ;
printf(“ok”);
R = 25 ;
else IF( R > = 0 )
{
printf(“Correct it”);
R = 3.14 * R * R ;
15) What is reprographics ? } else
printf(“ Positive Number “);
getch();
AL DEEN ACADEMY
GHOSIA INSTITUTE OF} TECHNOLOGY
ADDRESS : TALAT PARK 30 FT ROAD , LAHORE
Sir Asif Ashiq : 0328-3600060 Sir Saqib Ali : 0326-5864707
AL DEEN SCIENCE & ARTS
ACADEMY
Long Questions

1) What is control structure ? Breifly describe the basic control structure for
writing programs .
2) Explain the difference between if and if-else using example .
3) What is nested if explain with example ?
4) Write a program that display first 10 natural numbers using any Loop .
5) Write a program that takes three numbers as input and display the minimum number
using nested if statements
6) What is loop ? Explain for Loop ?
7) Define and explain switch statement with example
8) Write a program in C language that display first five numbers and display sum of the
numbers using while loop .
9) Explain if-else-if statement with flowchart , syntax and program .
10) Write a program In C language that display even numbers from 1- 100 and also show
the sum of the numbers
11) Write a program in C language that takes marks from user and show “ PASS “ if the
marks are greater then 40 .
12) Write a program that takes three numbers as input and dislay the largest number .

5 LOOP CONSTRUCTS

1) What is loop ? 2) Differentiate between counter and conditional loop ?


3) Describe the difference between while and do-while loop ? 4) Define While Loop ?
5) What is the syntax of for loop ? 6) What is the concept of nested loop ?
7) What is sentinel value ? 8) Define nested Loop ? 9) What is counter controlled loop ?
10) When a loop become infinity ? AL DEEN ACADEMY
GHOSIA INSTITUTE OF TECHNOLOGY
ADDRESS : TALAT PARK 30 FT ROAD , LAHORE
Sir Asif Ashiq : 0328-3600060 Sir Saqib Ali : 0326-5864707
AL DEEN SCIENCE & ARTS
ACADEMY
1) Write a program to find factorial of a given number using do-while loop .
2) Write a program that dislay first five numbers with their cubes do-while loop .
3) Explain “ Do while “ loop with its general syntax using a suitable examples
4) What is while loop also discuss its syntax , flowchart and program .
5) What is for loop also discuss its syntax , flowchart and program .
6) Write a program to print odd numbers from 1 – 10

6 Function in C
1) What is the life time of global variable ? 2) List different ways to pass parameters in function ?
3) What are formal parameters 4) What is the use of actual Parameter ?
5) What is local variable ? 6) Difference between built-in function and User defined Function?
7) How a function return a value ? 8) How is the data is provided to the functions ?
9) Why we use parameters in functions ? 10) Explain scope of a global variable in C ?
11) What is function ? 12) Define user defined function ? 13) What is local Variable ?
14) What is function definition ? 15) What is function call ?

Long Questions
1) How functions are declared and defined ? why we use functions in a
program ?
2) Write a program to compute the area of a rectangle when length and width
Are passed by ( Area = Length x Width )

AL DEEN ACADEMY
GHOSIA INSTITUTE OF TECHNOLOGY
ADDRESS : TALAT PARK 30 FT ROAD , LAHORE
Sir Asif Ashiq : 0328-3600060 Sir Saqib Ali : 0326-5864707
AL DEEN SCIENCE & ARTS
ACADEMY

7 File Handling C

1) What is EOP marker ? 2) What is meant by Rt and AT ? 3) What is Stream ?


4) What is Text Stream ? 5) Define string ? 6) How is the file opened? 7) How is file closed ?
8) What are hgeader Files ? 9) Write the names of two types of stream used in C Language ?.
10) Compare Binary and Text Stream. 11) What is text file ? 12) Define pointer?.

Sir Saqib Ali Sir Asif Ashiq


Assalam o Alaikum !

This notes are designed in this way that by preparing this notes you can gain better marks in Final Exams . Chapter

Special Thanks for Noor Ul ain for notes designing in unique style .

AL DEEN & GIT platforms are inshallah providing more notes is just for the learners …

For getting these notes you can contact us !

Email IDS :

Sir Asif Ashiq : asifashiq0341@gmail.com

Sir Saqib Ali : saqibshairali@gmail.com

Designed By : Noor Ul ain


AL DEEN ACADEMY
GHOSIA INSTITUTE OF TECHNOLOGY
ADDRESS : TALAT PARK 30 FT ROAD , LAHORE
Sir Asif Ashiq : 0328-3600060 Sir Saqib Ali : 0326-5864707

You might also like