Assignment-1 (PSUC) Sep-Dec2024 Batch
Assignment-1 (PSUC) Sep-Dec2024 Batch
Note: Kindly submit in handwritten only. If assignment found to be copy, then zero marks will
be awarded.
1. Draw a block diagram of Von Neuman architecture computer, with its major
components showing the transfer of data amongst its units. What is meant by stored
program concept?
2. Write a C program that performs the following tasks sequentially.
#include <stdio.h>
int main()
{
/*
Declare a variable named ‘temperature’ of type ‘float’.
Read the value of ‘temperature’ from user.
Prints the following messages based upon the value of ‘temperature’
(i) Prints “Freezing Weather” if ‘temperature is less than 0
(ii) Prints “Very Cold Weather” if 0 <= temperature <10
(iii) Prints “Cold Weather” if 10 <= temperature <20
(iv) prints “Normal Weather” if temperature >= 20
*/
}// End of Main
3. The length of three sides are taken as input. Write a C program to find whether a
triangle can be formed or not. If not display “This Triangle is NOT possible.” If the
triangle can be formed then check whether the triangle formed is equilateral,
isosceles, scalene or a right-angled triangle. (If it is a right-angled triangle then only
print Right-angle triangle do not print it as Scalene Triangle).
4. Write a C program and flowchart to find the maximum (minimum) among three
numbers and use it to find the maximum (minimum) among nine numbers.
5. Write a C program that returns a letter grade based on a quiz score. The input will be
the integer score from a ten-point quiz. The letter grades are assigned by:
9-10 “A”, 7-8 “B”, 5-6 “C”, 3-4“D”<3“F” using:
(a) If-else statements
(b) Switch Case statements
6. Explore the results of logical operators for the following below expressions, on declaration(s)
int a = 11, b = 7, c = 12, result:
(a) result = (a == b) && (c > b)
(b) result = (a == b) && (c < b)
(c) result = (a == b) || (c < b)
(d) result = (a != b) || (c < b)
(e) result = !(a != b)
(f) result = !(a == b)
(g) result=(a==10 + 15 && c < 10)
7. Explain the concept of storage classes in programming and write a program that
demonstrates the use of at least three different storage classes.
8. Write a program to calculate an amount of a telephone bill for the following criteria. (Without
Loop-switch case)
Calls Charge per call (Rs.)
1-150 0
151-250 .9
251-400 1.2
401 onwards 1.5