0% found this document useful (0 votes)
5 views2 pages

PSC Assignment 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

PSC Assignment 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CVR COLLEGE OF ENGINEERING

An UGC Autonomous Institution - Affiliated to JNTUH

B.Tech. I YearI Sem. Assignment -1 Subject: Problem Solving Through ‘C’

Assignment due date: 8-11-24 Branch: CSE (DS-C, DS-D)

Answer Any 4 Questions


1. a) Define a Computer and explain block diagram of a computer with neat sketch. CO1
BL1

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

b) Define operator Precedence, Associativity, and find the values of x, y, z using


operator precedence and associativity where a=2,b=10,c=20,d=4 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%

4. a) Write a C program to generate Fibonacci series of‘n’ terms using functions.CO2


BL3

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

7. A) compiler is defined as ------- B) Operating System is a-------- software

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>

int main() int main()

{ {

if( -12%-3) while( 1)

printf(“welcome to if”); {

else if(1)

printf(“welcome to else”); printf(“%d”, 45%5+5);

printf(“welcome to control statements”); printf(“%d”, (printf(“ CVRCE”));

return 0; break;} return 0;

} what is the output of G---- } what is the output of H----

H) Define Scope and life time of a variable -- I) Function is a -------------------

You might also like