Null Flowchart
Null Flowchart
_______________ ______________
Signature Signature
Computer Science Head of the
Teacher Department
______________
School Stamp
Index
S.No Practical Date Signature
SLO 9: Fundamentals of C Programming : (Arithmetic, relational, logical operators)
1. Write a program using all data types.
2. Write a program using Increment/Decrement operators.
3. Find the sum, product and average of given numbers.
Write C programs that use format specifiers (%d, %f, %s, %c), escape
sequences (alert, backspace, newline, carriage return, tab, backslash,
4.
single quotation mark, double quotation mark, question mark),
comments (//, /* */).
5. Convert Celsius to Fahrenheit temperature and vice versa.
Find the volume of a cube, cylinder, sphere or any other geometrical
6.
shape.
SLO 10: Selection Statement Programs: (if,then,else, swtich)
Calculate the grades of students on the basis of marks. The score sheet
7.
should contain name of the student, father’s name and class.
8. Show whether a number is positive, negative or zero.
9. Find the maximum and minimum values from inputted numbers.
10. Show whether a number is even or odd.
Generate the utility bill on the basis of charges allocated to each unit
11.
range. The bill should contain meter number and consumer name.
12. Determine whether a given number is prime number or not.
SLO 11: Loop Structure Programs: (For,while,do-while)
Generate a number series (even, odd, prime etc.) by taking input of
13.
starting and ending point.
14. Generate sum of series using loops.
15. Generate table of any inputted number up to the inputted range.
16. Calculate factorial of any inputted number.
Generate Fibonacci series starting from an inputted number and
17.
ending till the inputted range.
Print pyramid, rectangle, square or any geometrical shape using nested
18.
loops.
Input multiple values using loop and calculate average, maximum or
19.
minimum value using selection statement.
SLO 13: Office Automation II – ( MS Excel 2007 or Above )
20. Apply cell formatting tools like; number, alignment, font, border, fill.
Apply different functions to the data, i.e sum, average, count,
21.
minimum and maximum.
22. Insert a pie chart and bar graph in the data sheet.
23. Apply filter and data validation on spreadsheet data.
24. Protect a worksheet.
25. Lock/ unlock cells of spreadsheet.
PROGRAM # 1
#include <stdio.h>
int main() {
// Integer (int)
// Character (char)
// Float (float)
float pi = 3.14159;
// Double (double)
// Print values
return 0;
Algorithm
Step 1: Start
Step 2: Define the main() function, which serves as the entry point of the program.
Step 3: Declare variables of different data types (int, char, float, double, char[]) and initialize them with
respective values.
Step 4: Print the values of these variables using the printf function.
Step 6: Stop
Flowchart:
Start
Input variables:
( Int , char , float , double)
Initializing
End
PROGRAM # 2
#include <stdio.h>
int main() {
printf("Prefix increment:\n");
printf("\nPostfix increment:\n");
printf("\nPrefix decrement:\n");
printf("\nPostfix decrement:\n");
return 0;
}
Algorithm
Step 1:Start
Step 2: Initialize two integer variables, num1 and num2, both with a value of 10.
Step 5: Increment num1 using prefix increment (++num1) and print the updated value.
Step 8: Use postfix increment (num2++) on num2 and print the previous value (value before incrementing).
Step 11: Decrement num1 using prefix decrement (--num1) and print the updated value.
Step 14: Use postfix decrement (num2--) on num2 and print the previous value (value before decrementing).
Input integers:
Num1, Num 2
Increment
Decrement
End
PROGRAM # 3
#include <stdio.h>
int main() {
float average;
average = (float)sum / 3;
return 0;
}
Algorithm
Step 1: Declare variables num1, num2, and num3 to store three integers.
Step 2: Declare variables sum, product, and average to store the sum, product, and average of the three
numbers, respectively.
Step 4: Read the three numbers entered by the user and store them in variables num1, num2, and num3.
Step 5: Calculate the sum of the three numbers and store it in the variable sum.
Step 6: Calculate the product of the three numbers and store it in the variable product.
Step 7: Calculate the average of the three numbers by dividing the sum by 3 and store it in the variable average.
Step 9: Stop
PROGRAM # 4
#include <stdio.h>
int main() {
printf("Backspace: \b\n");
printf("Newline: \n");
printf("Backslash: \\ \n");
return 0;
Algorithm
Step 1 : Start
Step 4: Declare and initialize variables of different data types (integer, float, char, and string
Step 5: Print values of each variable using printf function with appropriate format specifiers.
Step 7 : stop
PROGRAM # 5
#include <stdio.h>
int main() {
int choice;
scanf("%d", &choice);
switch(choice) {
case 1:
scanf("%f", &temperature);
break;
case 2:
scanf("%f", &temperature);
break;
default:
printf("Invalid choice\n");
return 0;
Algorithm
Step 1: Start
Step 2: Display the temperature conversion menu including options for Celsius to Fahrenheit and
Fahrenheit to Celsius.
Step 3: Use a switch statement to execute different code based on the user's choice.
Step 4: If the user chooses option 1 (Celsius to Fahrenheit), prompt the user to enter the temperature
in Celsius, read the input, and perform the conversion using the formula (temperature * 9 / 5) + 32 .
Step 5: If the user chooses option 2 (Fahrenheit to Celsius), prompt the user to enter the temperature
in Fahrenheit, read the input, and perform the conversion using the formula (temperature - 32) * 5 / 9.
Step 6: Display the converted temperature. Step 8: If the user enters an invalid choice, display a
message indicating that the choice is invalid.
PROGRAM # 6
#include <stdio.h>
int main() {
int choice;
printf("1. Cube\n");
printf("2. Cylinder\n");
printf("3. Sphere\n");
scanf("%d", &choice);
switch(choice) {
case 1:
scanf("%f", &side);
break;
case 2:
scanf("%f", &radius);
scanf("%f", &height);
break;
case 3:
scanf("%f", &radius);
break;
default:
printf("Invalid choice!\n");
break;
return 0;
Algorithm
Step 1: Start
Step 4: Based on the user's choice: - If the choice is 1 (Cube): - Prompt the user to enter the side
length of the cube. - Read the side length. - Calculate the volume of the cube using the formula:
volume = side * side * side. - Display the volume of the cube. - If the choice is 2 (Cylinder): - Prompt
the user to enter the radius of the cylinder. - Read the radius. - Prompt the user to enter the height of
the cylinder. - Read the height. - Calculate the volume of the cylinder using the formula: volume = PI *
radius * radius * height. - Display the volume of the cylinder. - If the choice is 3 (Sphere): - Prompt the
user to enter the radius of the sphere. - Read the radius. - Calculate the volume of the sphere using the
formula: volume = 4.0 / 3.0 * PI * radius * radius * radius. - Display the volume of the sphere. - If the
choice is none of the above: - Display "Invalid choice!".
PROGRAM # 7
#include <stdio.h>
int main() {
int marks;
// Input
scanf("%s", fatherName);
scanf("%s", className);
scanf("%d", &marks);
// Grade Calculation
char grade;
grade = 'A';
grade = 'B';
grade = 'C';
grade = 'D';
else
grade = 'F';
return 0;
Algorithm
Step 1: Start
Step 2: Declare variables: - name, fatherName, className as arrays of characters to store student's
name, father's name, and class respectively. - marks as an integer to store the marks obtained by the
student. - grade as a character to store the calculated grade.
Step 4: Determine the grade based on the marks: - If marks are greater than or equal to 90, assign
grade 'A'. - Else if marks are greater than or equal to 80, assign grade 'B'. - Else if marks are greater
than or equal to 70, assign grade 'C'. - Else if marks are greater than or equal to 60, assign grade 'D'. -
Else assign grade 'F'.
Step 5: Output student's name, father's name, class, marks, and grade.
Step 6: End.
PROGRAM # 8
#include <stdio.h>
int main() {
int number;
scanf("%d", &number);
if (number > 0)
else
Algorithm
Step 1: Start
Step 4: Check if the number is greater than 0. - If true, print "number is positive." - If false, proceed to
the next step.
Step 5: Check if the number is less than 0. - If true, print "number is negative." - If false, proceed to the
next step.
Step 6: If the number is not positive or negative, it must be zero, so print "The number is zero."
Step 7: End.
PROGRAM # 9
#include <stdio.h>
int main() {
int n, i;
scanf("%d", &n);
scanf("%d", &num);
// Assume the first number as both max and min
scanf("%d", &num)
max = num;
min = num;
return 0;
Algorithm
Step 1: Start
Step 4: Assume the first number entered as both the maximum and minimum value
Step 5: Iterate through the remaining numbers from the second number to the total number of
elements.
Step 6: Inside the loop, prompt the user to input each subsequent number.
Step 7: Update the maximum value if the current number is greater than the current maximum.
Step 8 : Update the minimum value if the current number is smaller than the current minimum.
Step 9 : After all numbers have been input and processed, output the maximum and minimum values.
Step 10 : End the program.
PROGRAM # 10
#include <stdio.h>
int main() {
int num;
scanf("%d", &num);
if (num % 2 == 0) {
} else {
return 0;
Algorithm
Step 1: Start
Step 3: Check if the input number is divisible by 2 (i.e., if the remainder of division by 2 is 0).
#include <stdio.h>
int main() {
int meterNumber;
char consumerName[50];
int unitsConsumed;
float totalBill = 0;
scanf("%d", &meterNumber);
scanf("%s", consumerName);
scanf("%d", &unitsConsumed);
totalBill = 100 * 1.5 + (unitsConsumed - 100) * 2.0; // Charge rate for next 100 units
} else {
totalBill = 100 * 1.5 + 100 * 2.0 + (unitsConsumed - 200) * 3.0; // Charge rate for units above 200
printf("\nUtility Bill\n");
return 0;
}
Algorithm
Step 1:Start
Step 8: Determine the total bill amount based on the units consumed: - If units consumed is less than or equal
to 100, multiply the units consumed by the charge rate for the first 100 units (1.5). - If units consumed is
greater than 100 and less than or equal to 200, calculate the bill by adding the charge for the first 100 units and
the charge for the remaining units (2.0 per unit). - If units consumed is greater than 200, calculate the bill by
adding the charge for the first 100 units, the charge for the next 100 units, and the charge for the remaining
units (3.0 per unit).
Step 9: Print the utility bill details including the meter number, consumer name, units consumed, and total bill
amount.
PROGRAM # 12
#include <stdio.h>
if (num <= 1)
return 0;
if (num % i == 0)
return 0;
}
return 1;
int main() {
int number;
scanf("%d", &number);
if (isPrime(number))
else
return 0;
Algorithm
Step 1: Start
Step 2: Define a function isPrime that takes an integer num as input and returns an integer.
Step 6: If none of the conditions above are met, return 1 (indicating prime).
Step 10: Read an integer from the user and store it in the variable number.
Step 11: If the result of calling isPrime function with number as argument is true (non-zero), print number is a
prime number.
PROGRAM # 13
#include <stdio.h>
if (num <= 1)
return 0;
if (num % i == 0)
return 0;
return 1;
int main() {
scanf("%d", &start);
scanf("%d", &end);
if (i % 2 == 0)
}
printf("\n");
if (i % 2 != 0)
printf("\n");
if (isPrime(i))
printf("\n");
return 0;
Algorithm
Step 1: Start
Step 3: Define a function isPrime that takes an integer num as input and returns an integer.
Step 7: If none of the conditions above are met, return 1 (indicating prime).
Step 11: Read an integer from the user and store it in the variable start.
Step 12: Print "Enter the ending point: ".
Step 13: Read an integer from the user and store it in the variable end.
PROGRAM # 14
#include <stdio.h>
int main() {
int n;
float sum = 0;
scanf("%d", &n);
printf("Series: ");
for (int i = 1; i <= n; i++) {
if (i != n)
printf("+ ");
return 0;
Algorithm
Step 1: Start
Step 2: Declare integer variable n to store the number of terms and float variable sum to store the sum of the
series.
Step 4: Read an integer from the user and store it in the variable n.
Step 7: Print i and i+1 separated by a '/' to represent each term of the series.
Step 8: If i is not equal to n, print '+ ' to separate terms in the series.
Step 11: Print "Sum of the series: " followed by the value of sum with 2 decimal places.
PROGRAM # 15
#include <stdio.h>
int main() {
scanf("%d", &number);
scanf("%d", &range);
return 0;
Algorithm
Step 1: Start
Step 3: Declare integer variables number and range to store user input.
Step 5: Read an integer from the user and store it in the variable number.
Step 7: Read an integer from the user and store it in the variable range.
Step 10: Inside the loop, print " number x i = number * i".
#include <stdio.h>
int main() {
int number;
scanf("%d", &number);
if (number < 0) {
else {
factorial *= i;
return 0;
Algorithm
Step 1: Start
Step 5: Read an integer from the user and store it in the variable number.
Step 6: If number is less than 0, print "Factorial of negative numbers is not defined." and exit the program.
PROGRAM # 17
#include <stdio.h>
int main() {
scanf("%d", &start);
scanf("%d", &range);
first = second;
second = next;
printf("\n");
return 0;
Algorithm
Step 1: Start
Step 2: Declare integer variables start, range, first set to 0, second set to 1, and next.
Step 4: Read an integer from the user and store it in the variable start.
Step 6: Read an integer from the user and store it in the variable range.
Step 8: Print the first two numbers of the Fibonacci series, first and second.
Step 9: While the sum of first and second is less than or equal to range, do the following: - Calculate the next
Fibonacci number by adding first and second, and store it in next. - If next is greater than or equal to start, print
it. - Update first to the value of second. - Update second to the value of next.