Вы находитесь на странице: 1из 13

Assignment – 0

Programming for problem Solving(KCS-101/201)

Q.1 Differentiate between computer hardware and computer software.


Q.2 What do you understand by utility software? Is it must to have it.
Q.3 Give a brief description of generation of programming language. Highlight the advantages and
dis-advantages of languages in each generation.
Q.4 Define the following terms:
a. Booting.
b. BIOS.
c. Source Code.
Assignment - 01
Assignment: 1.1 Topic:Basics of computer

Subject Programming for problem Solving(KCS-101/201) Module 01 CO KCS101.1/201.1

Q.1 Discuss the memory hierarchy within the computer system in detail with diagram.

Q.2 Define an Operating system and its functions in detail.

Q.3 Write an algorithm and draw flowchart to find greatest among three numbers.

Q.4 Write an algorithm and draw flowchart to find factorial of number.

Q.5 Write an algorithm and draw flowchart to check whether input number is prime or not.

Q.6 Write the Difference between:


a) Compiler and Interpreter.
b) Linker and Loader.
Assignment : 1
Assignment : 1.2 Topic:Introduction of C

Subject Programming for problem Solving(KCS-101/201) Module 01 CO KCS101.2/201.2

Q.1 Why C is known as structured programming language?

Q.2 Explain the role of formatted input output statement in C.

Q.3 what do you mean by fundamental Data type? Explain different Data types available in C.

Q.4 Write a program in C to swap/interchange values of two numbers.

Q.5 Write a program in C to find compound interest where principal, rate and time entered by user.

Q.6 Write a short note on:


a) Syntax Error with example.
b) Logical Error with example.

Q.7 Explain the term token in C. Explain in detail with suitable example.

Q.8 Explain the following terms by taking suitable examples:


a. Keywords
b. Variables
c. Tokens
d. Constants
Q.9 Give the various rules for the identifiers / Variables.
Assignment - 02
Assignment : 2.1 Topic: operators in C

Subject Programming for problem Solving(KCS-101/201) Module 02 CO KCS101.2/201.2

Q.1 Explain all operators in C language along with suitable examples.

Q.2 Explain the term token in C. Explain in detail with suitable example.

Q.3 what will be the output?


void main()
{
int x=20,y=35;
x=y++ + x++ + ++y;
y=++y + ++x + y++ ;
printf(“x=%d ,y=%d\n”,x,y);
}

Q.4 Which precedence of two operators in an arithmetic expression is same, how associativity
helps in identifying which operator will be evaluated first. What is output of following code:

void main()
{
int a ,b=5,c=6,d=7;
a=(++b,c=c+b,d=d+c);
printf(“%d%d%d%d”,a,b,c,d);
}

Q.5 For given values of x,y,z evaluate the following expression: x=8,y=6,z=132
i) x<<1(left shift) ii) Y>>1(right Shift) iii) z>>1(right Shift)
Assignment : 2
Assignment : 2.2 Topic: Conditional statement

Subject Programming for problem Solving(KCS-101/201) Module 02 CO KCS102.3/201.3

Q.1 What is a difference between if-else and switch?

Q.2 Write a program to print hello without using semicolon.

Q.3 Write a program to find the greater of two nos using if-else ladder.

Q.4 Write a C program to perform arithmetic (Addition, subtraction, Multiplication, Division and
Modulus) operation using switch case.

Q.5 Company insures its drivers in following cases:


if driver is married .
if the driver is unmarried ,male and above 30 years of age.
if the driver is unmarried and above 25 years of age.
In all other cases, the driver is not insured. Write a program to determine whether the driver is
insured or not.

Q.6 Write a program to check whether a number is leap year or not.


Assignment-03
Assignment : 3.1 Topic: Iteration and loops (While, for loop)

Subject Programming for problem Solving(KCS-101/201) Module 03 CO KCS101.3/201.3

Q1 Write a C program to find sum of all even numbers between 1 to n using While Loop.

Q2 Write a C program to print multiplication table of any number using for loop.

Q3 Write a C program to find sum of first and last digit of a number using for loop.

Q4 Write a C program to swap first and last digits of a number using for loop.

Q5 Write a C program to find LCM of two numbers using While Loop.

Q6 Write a C program to find all prime factors of a number using While Loop.

Q7 Write a C program to print all Perfect numbers between 1 to n using While Loop.

Q8 Write a C program to print armstrong numbers between 1 to n using While Loop.

Q9 WAP to check whether given number is palindrome or not.

Q10 Write a C program to print the following pattern:


a)
*
* * *
* * * * *
* * * * * * *
b)
A
B C
D E F
G H I J
Assignment – 3

Assignment – 3.2 Topic: Do-While Loop, break & continue Statement

Subject Programming for problem Solving(KCS-101/201) Module 03 CO KCS101.3/201.3

Q1 Differentiate between the following (also take suitable examples):


a. while & do–while
b. break & continue

Q2 Write a C program to find frequency of each digit in a given integer using do-while loop.

Q3 Write a C program to calculate product of digits of a number using do-while loop.

Q4 Write a C program to find all factors of a number using do-while loop.

Q5 How to use break & continue statement in C? Explain with some sort of code.

Q6 What is case control structure in C? What is the reason for using break statement at the end of
each case in case control block?
Assignment – 3
Assignment – 3.3 Topic: Functions, Recursion

Subject Programming for problem Solving(KCS-101/201) Module 03 CO KCS101.4/201.4


KCS101.3/201.3

Q1 What is function? Why programmer uses function in code? While executing a function, how the values are
passed between calling and called environment?

Q2 What do you mean by call by value and call by reference? Write a program for swapping two numbers
using call by value and call by reference technique.

Q3 Differentiate between recursion and iteration.

Q4 Write a program in C to calculate power of a number using recursion.

Q5 Write a program in C to count digits of a number using recursion.

Q6 Write a program in C to calculate the sum of numbers from 1 to n using recursion.

Q7 Write a program in C to find GCD of two numbers using recursion.

Q8 What is a storage class? Explain all the storage classes with example.
Assignment - 04
Assignment – 4.1 Topic: Array

Subject Programming for problem Solving(KCS-101/201) Module 04 CO KCS101.5/201.5

1. What are the subscripts? How are they specified?


2. Write a program in c to find the largest number of element in 4* 4 matrixes.
3. Write a program in c to reverse a string using pointer.
4. Write a program to add two matrices of dimension 3*3 and store the result in another matrix.
5. Write a program to multiply two matrices (read size and number of element of both matrices
from the keyboard. )
6. Differentiate between array and pointer.
7. Write a C program to input 10 elements in an array and find out the largest number in array
using array passing to function.
Assignment – 4

Topic: Structure/union/enumeration
Assignment – 4.2
04 CO KCS101.5/201.5
Subject Programming for problem Solving(KCS-101/201) Module

1. Write a program in c to create a database of fifty students to store personal details such as roll
number, name and marks. Print the details of students whose name is entered by user.
2. Write a program to compares two given dates. To store date use structure say date that contains
three members namely date, month, year. If dates are equal then display message as “Equal”
otherwise “Unequal”.
3. Differentiate between structure and union by giving suitable example.
4. What is enumerated data type in c? Explain with suitable example.
Assignment – 4
Assignment – 4.3 Topic: Sorting / searching /complexity

Subject Programming for problem Solving(KCS-101/201) Module 04 CO KCS101.5/201.5

1. Write a program in to sort given list of integers using selection sort:


23, 45, 12, 7, 19, 53
2. Write a program in C to implement binary search algorithm.
3. Write a program in c to sort an array of integers in ascending order using bubble sort.
4. Differentiate between linear search and binary search with suitable example.
5. What do you mean by the order of complexity? Explain various notations to represent order of
complexity.
Assignment – 5
Assignment – 5.1 Topic: Pointer , Dynamic Memory Allocation, Linked List

Subject Programming for problem Solving(KCS-101/201) Module 05 CO KCS101.5/201.5

Q1 What are pointers? Why are they required? How do you declare and initialize them? Illustrate
With suitable example.
Q2 Explain the concept of linked list and its types in detail
Q3 Differentiate between Static allocation and Dynamic allocation.
Q4 What do you mean by dynamic memory allocation? Explain malloc() and calloc() function
with suitable example.
Q5 What is memory leak in C.
Q6 Write a short note on:

1) Self Referential Structure.


2) Void Pointer.
3) Dangling Pointer.
Assignment – 5
Assignment – 5.2 Topic: File Handling, Preprocessor Directive.

Subject Programming for problem Solving(KCS-101/201) Module 05 CO KCS101.5/201.5

Q1 What do you mean by C preprocessor directive? List all preprocessor directives and explain
any two. What will be the result of the following macro call statement?
#define CUBE(a) a*a*a
CUBE (x+x). If x=12?

Q2 What is file and different file opening modes? Write a program to copy the content of one
file to another file. Also display the copied content.

Q3 Write a C program to compare two files.


Q4 Write a C program to count characters, words and lines in a text file.
Q5 Write a C program to remove a word from text file.
Q6 Write a C program to find and replace a word in a text file.