Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Q.1 Discuss the memory hierarchy within the computer system in detail with diagram.
Q.3 Write an algorithm and draw flowchart to find greatest among three numbers.
Q.5 Write an algorithm and draw flowchart to check whether input number is prime or not.
Q.3 what do you mean by fundamental Data type? Explain different Data types available in C.
Q.5 Write a program in C to find compound interest where principal, rate and time entered by user.
Q.7 Explain the term token in C. Explain in detail with suitable example.
Q.2 Explain the term token in C. Explain in detail with suitable example.
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
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.
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.
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.
Q2 Write a C program to find frequency of each digit in a given integer 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
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.
Q8 What is a storage class? Explain all the storage classes with example.
Assignment - 04
Assignment – 4.1 Topic: Array
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
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:
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.