PSC Assignment 1
PSC Assignment 1
b) Write an algorithm and design a flowchart to find the sum of the individual digits of
a given number.CO1 BL2
2. a) Define operator and explain conditional and bitwise operators in C with suitable
examples .CO1 BL1
i) x= a+b*c/d
ii) y= a-b+(c*d/a)
iii) z=a*(b-(c+d))
3. a) Difference between While and Do-while, and write a C program to print the
following format CO2 BL3
1
23
456
7 8 9 10
b) Write a C program that read basic salary of an employee and calculate the gross
salary of an employee, with the following details. CO2 BL4
If the Basic Salary is less than or equal to 10000 then HRA = 10% of the basic,
and DA = 15% of the basic
Basic Salary is less than or equal to 20000 then HRA = 20% and DA = 25%
Basic Salary is greater than 20000 then HRA = 24% and DA = 30%
b) Differentiate static and auto storage class with the help of example.CO2 BL4
5. Define recursion and write a C program that uses choice based recursive procedure to
compute the following .CO3 BL5
i) sum of n natural numbers ii) factorial of given number ii) GCD of 2 numbers
6. a) Write a C program to find area and perimeter of a circle using PI variable as pre-
processor directive. CO3 BL3
b) Define i) Macro ii) File Inclusion iii) List out conditional compilation
directives.CO3 BL1
C) if x=32, y=x<<2 then the value of y is------ D) if x=3, y=9, z=-10, p= x*4/8-
2+(z/2*5+ x++ + --y) then the values of p, x, y are -------- E) The basic unit used to
measure the computer memory is------- F) define actual and formal parameters---
G) #include<stdio.h> H) #include<stdio.h>
{ {
printf(“welcome to if”); {
else if(1)