About Me

My photo
Vijayapur, Karnataka, India
I am interested in Teaching.

Tuesday, 17 May 2022

Module wise Important Questions 21PSP13 ...You find the video on same....

 

Dear students,

A very good morning to all.

In this lecture video, let us revise the subject module wise…So that you can do well in exams!.....

Module-1

Important topics to be revise and practice are as follows.

1.  Block diagram of computer or Structure of Computer

Draw diagram neatly with input unit, process unit, output unit.

Process Unit àincludes MU (Memory Unit) and CPU àIncludes (CU + ALU)

Ok!

Draw diagram=2 marks

Explain all units with quality points.

Input Unit

Processing Unit

        Memory Unit

        ALU

        Control Unit

Output Unit

Ok!

 

2.  Input and Output Devices (list and explain in brief!)

3.  Computer Generations (5 types) List and Explain quality points

4.  Types of Computers

Analog, Digital and Hybrid (On the basis of working principle)

Single User: Desktop, Workstation, Laptop, Tablet, Smart Phone, etc.

Multi User: Mini, Mainframe, Super Computer

Explain all the above …Ok!

 

Computer Network: Definition, Advantages.

Types of Networks

PAN (Personal Area Network)

LAN (Local Area Network)

MAN (Metropolitan Area Network)

WAN (Wide Area Network)

 

 

Types of Network Topologies:

Bus topology

Ring topology

Star topology

Mesh topology

Tree topology

Hybrid topology

Explain all with freehand sketch, few points.

Ok!

 

 

 

Network Components

NIC (Network Interface Card)

Hub

Switch

Repeater

Bridge

Gateway

List and Explain ok….

 

 

 


Structure of C Program (IMP)

Write structure and Explain all sections.

[Documentation Part]

[Pre processor Part]

[Global part]

int main()

{

declaration part;

executable part;

return 0;

}

user defined functions

 

Explain all the above with examples.

Write one program as example.


Ex:

/* C program to find largest of 2 nos using function*/              documentation part

#include<stdio.h>                           preprocessor part

int max(int, int);                               global part

void main()                                        main function

{

int n1, n2, ans;                                  declaration part

printf(“Enter two nos”);                               executable part

scanf(“%d%d”,&n1, &n2);

ans=max(n1,n2);

printf(“\n Largest no is %d”,ans);

}

int max(int x, int y)                                         user defined function

{

if (x>y)

                return x;

else

                return y;

}

 

Ok!

 

All the best


What are formatted I/O functions? Discuss with syntax and examples.

1.scanf()

Syntax:

scanf(“No of format specifiers”,&v1,&v2,…,&vn);

Where,

format specifiers: %d, %f, %s, %u, %ld, %hd, etc.

&v1,&v2…Valid variables with ampersand sign

 

2.printf()

Syntax:

printf(“text message with format specifiers”,v1,v2,…,vn);

 

Examples;

Explain above two

Write syntax

Give examples…

Ok

 



Unformatted I/O functions are

getch() and putch()

gets() and puts()

If you get question on it

Explain with syntax and examples.

refer my notes…ok

 

List and explain the Operators.

Arithmetical operators

Relational operators

Logical operators

increment and decrement operators

conditional operator

bitwise operators

assignment operators

special operators like comma and sizeof

..Practice all

..Give examples.

Refer notes….

ok!

 

Typecast or type conversion

1.implicit type conversion

This conversion is done by machine/compiler automatically

ans=1/2=0

2.explicit type conversion

This conversion is done by programmer to get accurate results.

ans=(float)1/2=0.5

ans=1/(float)2=0.5

refer notes for more examples

 

What is precedence and associativity of operators?

Refer notes.

 

 


What are data types? List and explain.

char %c    1 byte                 range of values (refer notes)

int    %d    2 bytes

float %f     4 bytes

double      %f     8 bytes

void           no value  

Explain all with range of values

 

Conversion of mathematical expression to  c expression

refer notes or

search lecture video…Ok

 

 

 

What is algorithm?

Step by step procedure to solve a given problem with finite number of steps.


Examples:

Algorithm to calculate simple interest

step-1: start

step-2: read p, t and r

step-3: calculate SI=(ptr)/100

step-4: print SI

step-5: Stop

Flowchart:

Diagrammatical representation of algorithm is called flowchart..

See video

or

refer lecture notes…ok

 

 

 

 

 

 

 

 

 

Simple C programs

1.   To calculate simple interest

2.   To calculate addition, subtraction, multiplication and division of two numbers

3.   To find area and perimeter of rectangle

4.   To find area of triangle by reading B and H (area=0.5*b*h)

5.   To find area of triangle by reading 3 sides a,b and c

s=(a+b+c)/2

area=sqrt(s*(s-a)*(s-b)*(s-c))

Ok

6.   Swap two values using temporary variable

temp=a

a=b

b=temp

7.   Swap two values using without using temporary variable

a=a+b

b=a-b

a=a-b


Module-2

Conditional or Selection or Decision Making or Branching Statements

1.   if

2.   if else

3.   nested if

4.   else if ladder (cascaded if)

5.   switch (very important) practice syntax, flowchart ,example

Practice all the above

with explanation, flowchart and example.

Note: refer notes and videos

Loop or Iterative Statements

1.   while (entry controlled or pre test loop)

2.   do while *exit controlled or post test loop)

3.   for

Difference between while and do while

Programs: refer notes or videos…

1.   palindrome

2.   GCD using Euclids algorithm

3.   Fobonacci

4.   Factorial

Jump Statements

1.break

2.continue

3.goto

refer notes and videos

Module-3

Arrays and Strings

What is 1D and 2D array?Discuss its declaration and initialization with syntax and examples.

very important question…you get it….

Please practice

Syntax is very important

1D array

datatype arrayname[size];

2D array

datatype arrayname[row size][column size];

 

refer notes for further

Watch videos..ok!

 

 

 

 

 

 

 

 

Bubble sort

Selection sort

Largest and lowest of n numbers

Sum and Average of N numbers

Refer notes

Watch videos

practice Lab Programs

Strings

What is string? Discuss declaration and initialization.

Definition

Syntax

char string name[size];

Examples:

 

Read and Write strings:

gets() reads string till we press enter key

puts() prints string

Syntax

gets(string_variable)   puts(string_variable)

 

 

 

 

String manipulating Functions:

strlen()

strcpy()

strncpy()

strcmp()

strncmp()

strcat()

strncat()

strlwr()

strupr()

strrev()

Refer notes and see video

 

All the best

 

 

 

Programs:

C program to find length of string without using function.

Practice all taught programs without using functions….

Refer notes.

 

 

Module-4

Functions

What is function? List advantages.

Function can be defined as sub program

It also includes set of instructions to do specific task.

Advantages

1.Reduction in the size of main()

2.Modular programming approach (Divide and solve the problems)

3. Reusability

4. Program debugging, maintenance and testing is easier

5.We can create our own library of functions

 

Elements of User defined functions:

1.Function Declaration (prototype)

2.Function Call

3.Function Definition

Above all 3 with explanation, syntax and examples.

See Video or refer notes…

 

 

 

 

 

 

Categories of functions based on arguments and return value

1.functions with arguments and return value

2.functions with no arguments and return value

3.functions with arguments and no return value

4.functions with no arguments and no return value (Parameter less functions)

Explain all 4 with examples.

Refer notes

or Watch video

 

 

 

 

 

Actual and Formal Parameters.

Refer notes

Give examples

 

 

Parameter passing mechanisms

call by value

call by reference(address)

Write difference between both

Refer notes

Watch video

 

What is recursive function? Give example.

A function that calls itself is called recursive function.

Example:

To find factorial

#include<stdio.h>

long int fact(int);

void main()

{

int n;

long int ans;

printf(“Enter n”);

scanf(“%d”,&n);

ans=fact(n);

printf(“\nFactorial is %ld”,ans);

}

 

 

 

 

 

 

long int fact(int x)

{

if (x==0 || x==1)

       return 1;

else

       return (x * fact(x-1));

}

Ok!

 

Storage Classes Used in C

1.local or private or automatic variables

2.global variables

3. static variables

4.register variables

refer notes or watch videos

 

 

Module-5

Structure and Pointers, Preprocessors.

 

What is structure? Discuss the declaration and initialization of structure and structure variable with syntax and examples.

 

Definition of structure

Syntax:

struct <tag name>

{

type1  member1;

type2  member2;

type3  member3;

};

 

Ex:

struct student

{

int rno;

char name[25];

int marks;

float avg;

};

 

struct student s1,s2,s3;

 

Give example

Refer notes or watch video

 

 

What is array of structure? Give example with syntax

 

Syntax:

 

struct <structure name>[size];

 

Example:

struct student s[50];

 

Give programming example.

Refer notes or watch video

 

 

 

 

What is nested structure? Give example.

Structure within structure is called nested structure

Example

struct date

{

int dd,mm,yy

};

struct student

{

int rno;

char name[25];

struct date dob,doa,dor;

}

Ok!

 

 

What is pointer? Write its advantages. (Refer notes) or video

 

 Discuss its declaration and initialization with syntax and examples. (very important)

 

 

Pointer is also a variable. It stores only ADDRESS of another variable.

Syntax for declaration

data type *pointer name;

Ex: int *ip, float *fp, char *cp;

Initialization

pointer=&variable;

Ex: int n;

       int *ip;

       ip=&n;

 

float ans;

float *fp;

fp=&ans;

 

char ch;

char *cp;

cp=&ch;

 

refer notes and videos….

 

 

Dynamic Memory Allocation

Process of allocating the memory during program run is called DMA.

malloc()

calloc()

realloc()

free()

Explain

Write syntax

Give example

Refer notes and videos

 

 

 

 

 

What are pre processors? List the types and give examples.

Pre processors are the small programs

These will run before the main() runs

All pre proessors atarts with # sign

They do not end with ;

There are also called directives

 

 

Types:

1.Macro Substitution Directives

# define PI 3.142

# define MAX 100

# define MIN 0

2. File inclusion directives

# include<stdio.h>

#include<conio.h>

#include<math.h>

3.Compiler Control Directives

#if

#elif

#endif

Refer notes

 

 

 

 

 

In Module 1:

What are c tokens? List and explain in brief.

Keywords

Identifiers

Constants

Strings

Operators

Special Symbols

 

Write rules for defining variable(identifiers) with valid and invalid examples.

Important practice the same.

 

What is variable? How to declare and initialize? (Syntax and Examples)

 

Important Programs for exams.

1.Simulation of calculator

2.Simple interest

3.Area of rectangle + its perimeter

4.Area of triangle

5.largest of 3 nos

6.Leap year or not leap year

7.Swap values

8.PALINDROME

9.GCD

10.     Fibonacci

11.     Bubble Sort

12.     Selection Sort

13.     Largest and Lowest of N numbers

14.     Prime number or Not Prime

15.     Factorial

16.     Matrix Multiplication

17.     Vector Addition

18.     Examples using structure

19.     Examples using array of structure

20.     Examples of using pointers

21.     Examples using malloc

22.     Examples for pre processors.

 

 

 

 

 

 

 

 

 

 

Dear students,

Attempt those questions first in which you are perfect

Do not waste the time

Select appropriate question

 

Practice some programs

If you won’t get then write those programs as examples….ok!....

Write neatly.

 

All the best!....

Thank you for the patience…..

All the best……

All the best….

 

 

 

No comments: