2021 CE143 Practical List
2021 CE143 Practical List
:2021-22
1 1.1 Write a C program that will output this passage by Michael Singer. Make sure your
output looks exactly as shown here (including spacing, line breaks, punctuation, and
the title and author). Use Required Escape Sequence and ASCII Value.
Outcome:
Note:
There are three shapes in the output: Smiling Face, Diamond & Heart.
The ASCII Value for Smiling face is 1.
1.2 Write your bio-data using Escape Sequences. And you have to take your Basic
Information as user input. It should contain the following content. It should contain
the following content.
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output
CE143 : Computer Concepts and Programming A.Y. :2021-22
Questions:
1. What is the purpose of using escape sequences? Answer in one or two statements.
Mention any 5 escape sequences used regularly along with their purpose.
Sr. No. Escape Sequence Purpose
1
2
3
4
5
CE143 : Computer Concepts and Programming A.Y. :2021-22
2. 2.1 In a town, the percentage of men is 52. The percentage of total literacy is 48. If total
percentage of literate men is 35 of the total population, write a program to find the total
number of illiterate men and women if the population of the town is 80,000.
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Fill below mentioned table as per your output.
Sr. No. Get Outcome Value
1 Total Population
2 Number of Literate (Men + Women)
3 Number of Men
4 Number of Literate Men
5 Number of illiterate Men
6. Number of Women
7. Number of Literate Women
8. Number of illiterate Women
Questions:
1. Has this scenario helped you learn about integer and float datatype? If yes, then
mention the requirements of using integer and float data types.
CE143 : Computer Concepts and Programming A.Y. :2021-22
2.2 A Bigbazaar cashier has currency notes of denominations 10,50 and 100. If the amount
to be withdrawn is input through the keyboard in hundreds, find the total number of
currency notes of each denomination the cashier will have to give to the withdrawer.
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output
Fill up the required number of currency notes of denomination 10, 50 and 100 in below
given table as per the output received.
Sr. No. Note Requirements Counts
1 Requirement of 100 Rs. note
2 Requirement of 50 Rs. note
3 Requirement of 10 Rs. note
Questions:
1. Have you learned about how scanf function can be used to collect the user input?
Give the correct answer for the following table:
2.3 Write a program to calculate Net Salary. User has to input Basic Salary and Output
should be:
Enter Basic Salary: 5000 (e.g. 5000)
Allowances:
DA = 70% of Basic Salary
HRA = 7% of Basic Salary
MA = 2% of Basic Salary
TA = 4% of Basic Salary
Deduction:
PF = 12% of Basic Salary
IT = any value (e.g. 500)
3 3.1 Write a program that takes the length of the pendulum as input and then calculate the
time period of the pendulum. Provided that, T=2π√L/G. Define the value of π as 3.14
and take L as the length of the pendulum and G as the acceleration of gravity either in
m/s or as input from the keyboard. Display the time period rounded to 2 decimal
places.
Hint:
Use Math.h header file, use #define for specifying the value of π
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Fill up the output as per the inputs mentioned in below given table as per the output
received in console.
CE143 : Computer Concepts and Programming A.Y. :2021-22
Input Output
Sr. No.
Length Gravity Time Calculated(seconds)
1. 50 m 9.8 m/s2
2. 50 m 0 m/s2
3. 50 m 0.9993 g
4. 50 m -1 g
Questions:
1. Have you learned about, how math function is useful for calculating square root?
Which datatype is supported by all math functions? Also mention any 5 math
functions with their purpose.
Sr. No. Math function Description
1.
2.
3.
4.
5.
Expected Outcome:
Fill up the data mentioned in below given table as per the output received.
Sr. No. Instructions Yellow
1. Count before execution
2. Count after execution
b) Consider another scenario where boys and girls both are asked to add/remove
Yellow and Pink balls from the bucket respectively. Currently there are 10
Yellow balls in the bucket and 20 Pink balls.
Teacher has given the sequence of instructions as below for adding/removing
the balls.
Calculate = ++Yellow + Yellow++ + --Yellow + ++Pink - --Pink - --Pink
Get the count of Yellow and Pink balls after evaluating above given scenario.
CE143 : Computer Concepts and Programming A.Y. :2021-22
Expected Outcome:
Fill up the data mentioned in below given table as per the output received.
Sr. No. Instructions Yellow Pink
1. Count before execution
2. Count after execution
Also get the count of calculate and explain how it is calculated in stepwise manner.
(hint: left to right, as per memory)
Questions:
Have you understood the working of Pre-increment, Post-increment, Pre-decrement and
Post-decrement?
Rubrics: Output should be as mentioned in the expected outcome, if it is imperfect then
submission marks are proportional.
3.3 Write a C program to swap two numbers (use two variables for collecting value from
user) without using third variable. (Hint: Use arithmetic operators)
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Fill up the output as per the output received in console.
Sr. No. Instruction Number1 Number2
1. Before Swapping
2. After Swapping
Questions:
1. Have you learned about, how we can use arithmetic operators for swapping the
numbers?
CE143 : Computer Concepts and Programming A.Y. :2021-22
4 4.1 a. Write something about your characteristics not more than 50 words using gets
function and print out the same using puts function.
Expected Outcome:
Draw flowchart, write algorithm and write program for given scenario. Also attach the
screenshot of output.
Questions:
1. What is the significance of using gets and puts? Are they acting as replacement
of any function? How?
b. Write a program to convert the decimal number into octal and hexadecimal
format. Print hexadecimal and octal values for given inputs in expected
outcomes.
Hint: Use %o and %x
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Fill up the output as per the inputs mentioned in below given table as per the output
received in console.
Sr. No. Inputs Octal Hexadecimal
1. Your Roll No
2. 143
3. 0
4. 1
5. -1
4.2 Write a C Program to Print multiplication table from 1 to 7 to achieve the following
output. (Use #define directives and do while loop)
Expected Outcome:
Draw flowchart, write algorithm and write program for given scenario.
CE143 : Computer Concepts and Programming A.Y. :2021-22
5 5.1 Write a C program for the given scenario from the flowchart. Note that you have to
enter your own height in centimeters.
Expected Outcome:
Write algorithm and write program for given scenario. Also attach screenshot of output.
Tick marks your achieved result in the appropriate column:
Sr. No. Inputs (cm) Dwarf Average Tall Abnormal
1. Your Height
2. Your Mother’s height
3. Your Father’s height
4. Your Sibling’s height
CE143 : Computer Concepts and Programming A.Y. :2021-22
5.2 Write a C program to find all roots of a Quadratic equation using nested switch case.
Take three user inputs from keyboard for finding the discriminant (b2 – 4ac). Use the
concept of nested switch case for finding the roots of equation. Get the outputs for roots
till 2 decimal points only.
Hint:
Discriminant > 0
root1 = (-b + sqrt(discriminant)) / (2*a)
root2 = (-b - sqrt(discriminant)) / (2*a)
Discriminant < 0
root1 = root2 = -b / (2*a)
imaginary = sqrt (-discriminant) / (2*a) (eg. Print it as: i20.3, i.e. i followed by value)
Discriminant = 0
root1 = root2 = -b / (2*a)
Expected Output:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Input values in the console as per the table given below and write the results in the table,
based on received output.
Sr. No. Inputs Root1 Root2 Imaginary
a b c
1. 1 2 3
2. 3 -7 -5
3. 9 12 4
Questions:
1. Have you learned about how to use normal switch case and nested switch case?
2. Is default case necessary for every switch case?
3. What if break statement is not mentioned between two consecutive cases?
5.3 If the ages of Ram, Shyam and Ajay are input through the keyboard, write a program
to determine the youngest of the three. If all of them are of same age then print that “All
are of same age”. (Hint: Use Nested if else statement)
Expected Output:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Take different input values as per your wish and given scenario get output.
Sr. No. Inputs Expected
Ram Shyam Ajay Output
1. Same Same Same All are of equal age
2. Different Different Different Ram/Shyam/Ajay is
youngest
3. Same Same Different Ram and Shyam are
equal
CE143 : Computer Concepts and Programming A.Y. :2021-22
6 6.1 There is a person, who is asked to enter the alphanumeric password for registering into
an ecommerce website for purchasing products from website. But he is not aware about,
what does Alphanumeric mean. So, he tries entering various combinations 5 times, but
he fails to create such password. So let us help him by writing a C program to validate
his password. Constraints for writing password are it should have combination of
lowercase, uppercase and digit.
Note: Use Do while loop, and give print appropriate outputs on incorrect validations.
Expected Outcome:
Draw flowchart and write algorithm and write program for given scenario.
Mention all the inputs that you have experimented and outputs received. Also mention
the correct alphanumeric password created by you.
Sr. No. Inputs Output
1. Mention here the passwords used for Password does not satisfy
wrong experiments constraints!!! Please try
again
2. Mention the passwords that gave you Good Password, you may
correct validation proceed
Questions:
1. Have you understood working of do…while loop? Do mention the syntax of
this loop.
2. Have you used for loop in this program?
3. What is goto statement? How is it useful?
6 6.2 Two numbers are entered through the keyboard. Write a program to find the value of
one number raised to the power of another. (Use While loop)
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Mention at least 3 different inputs that you have experimented and outputs received.
Sr. No. Base No. Power Output
1.
2.
3.
Questions:
1. Have you understood the concept of while loop? if yes write its syntax here.
CE143 : Computer Concepts and Programming A.Y. :2021-22
6.3 Write a C program for Big bazaar cashier to count the amount to be collected from the
customer. Cashier will enter the numbers one after another for each item and to get the
summation of entered numbers, he has to enter 0.
(Use for loop) (Hint: Break statement can be used)
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Mention at least 3 different inputs that you have experimented and outputs received.
Sr. No. Entered Number Summation after entering 0
1.
2.
…
…
N.
Questions:
1. Have you learned the concept of for loop using above given scenario? Explain
what does ‘i’ stands for in the for() loop, consider the given example below.
E.g. for(i=0;i<10;i++)
6.4 Write a program for a match-stick game between the computer and a user.
Your Program should ensure that the computer always wins. Rules for the games are as
follows:
● There are 21 match-sticks.
● The computer asks the player to pick 1, 2, 3, or 4 match-sticks.
● After the person picks, the computer does its picking.
● Whoever is forced to pick up the last match-stick loses the game.
Use while loop, break and Continue Statements.
To understand the above game in a better way, visit the following link:
http://atozmath.com/Games/21MatchStick.aspx
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Write the sequence of sticks inputted by you and computer one after another.
Sr. No. Entered Number Entered Number Sticks left
by User by Computer
1.
2.
…
…
N.
Questions:
1. What is the significance of using break and continue statement?
CE143 : Computer Concepts and Programming A.Y. :2021-22
7 7.1 Twenty-five numbers are entered from the keyboard into an array. Write a C program
to find out how many numbers of them are positive, negative, and how many are even
and odd?
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Enter the counts of positive, negative, even and odd numbers in the below given table
as per the output received.
Sr. No. Parameter Counts
1. Positive Numbers:
2. Negative Numbers:
3. Even Numbers:
4. Odd Numbers:
Questions:
1. Is it necessary to initialize a variable with zero everytime? If yes, then why? If
No, then when is it necessary to initialize the number with zero and why?
7.2 Write a program for creating two arrays of different size and merge both arrays into one
by sorting those arrays in ascending order. [Merge by sorting]
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Following screenshot showcases the expected outcome, you can enter the input values
of your choice
8 8.1 Help user to identify how strong is his password based on the number of lowercase
alphabets, uppercase alphabets, digits and special characters given by the user from the
keyboard. Length of entered password(string) should be of 8.
Constraints for identifying strength of password:
1. Strong: Mixture of lowercase alphabets, uppercase alphabets, digits and special
characters
2. Average: Mixture of lowercase alphabets, digits and special characters
3. Poor: Either only has alphabets/digits/special characters
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Look at the example given in table and try various test cases such a way to get the varied
strength of password (Strong/Average/Poor).
Sr. No. Input Lowercase Uppercase Digits Symbol Output
Example Abc@1234 ✓ ✓ ✓ ✓ Strong
1.
2.
3.
Questions:
1. Explain the difference between string and character. Also write the syntax for
printing character and string.
CE143 : Computer Concepts and Programming A.Y. :2021-22
8.2 Let us assume, teacher is supposed to allot seats based on the student’s names. You are
requested to help teacher by creating a C program, for collecting the names of 5 students
and sort them in alphabetical order.
Hint: Use string functions, use fgets function to collect the names of students.
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Enter the inputs entered by you for 5 names, and give the output how they are sorted.
Sr. No. Input of names Sorted Output as per output
1.
2.
3.
4.
5.
Questions:
1. Which string functions have you learned from this program? Explain any 5
string functions in below given table.
Sr. No. String Functions Syntax Purpose
1.
2.
3.
4.
5.
8.3 Write a C program to check if the user inputted string is palindrome or not using
recursion.
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Enter the following test inputs and give the output as per the output gained.
Sr. No. Input Sorted Output as per output
1. Alpha
2. Madam
3. saippuakivikauppias
4. Hannah
Questions:
1. Explain the concept of recursion. Explain the difference between recursion and
iteration?
CE143 : Computer Concepts and Programming A.Y. :2021-22
9 9.1 Write a C program to check if the entered number is prime or not by using types of user
defined functions
(i) No arguments passed and no return value
(ii) No arguments passed but a return value
(iii) Argument passed but no return value
(iv) Argument passed and a return value
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Enter the details into the table based on the inputs entered by you and tick mark the
column, whether the inputted value is prime or non-prime:
Sr. No. User Defined Functions Input Prime Non-Prime
1. No arguments passed and
no return value
2. No arguments passed but a
return value
3. Argument passed but no
return value
4. Argument passed and a
return value
Questions:
1. You might be clear now, how user defined functions are created in different
ways. Explain them.
9.2 Verify the triangle, if the length of the sides of a triangle are denoted by a, b and c, then
the area of triangle is given by:
a b c
1.
2.
3.
Questions:
1. Explain the concept of nested functions in C.
9.3 A positive integer is entered through the keyboard, write a function to find the binary
equivalent of this number using recursion.
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Enter the inputs for converting the number into binary form, try it for three different
inputs and fill the below given table:
Sr. No. Input Binary
1.
2.
3.
Questions:
1. Mention the advantages of using recursion in a program.
10 10.1 Write a C program to create a structure of Book Detail and display the details of the
book in appropriate format by passing structure as a function argument.
Book Detail must contain following information:
Book Title, Author name and Amount of book in float.
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Enter the inputs for converting the number into binary form, try it for three different
inputs and fill the below given table:
Sr. No. Book Title Author Name Amount of book
1.
2.
3.
Questions:
1. Can we declare function inside structure of C Programming? Explain Why?
10.2 Create a Union called library to hold accession number, title of the book, author name,
price of the book and flag indicating whether the book is issued or not. (flag = 1 if the
book is issued, flag = 0 otherwise). Write a program to enter data of one book and
display the data.
Expected Outcome:
CE143 : Computer Concepts and Programming A.Y. :2021-22
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Enter the inputs for collecting the details for library books. Here, if user inputs flag=1,
then book is issued else book is not issued.
Accession
Sr. No. Title of Book Author Price Flag Output
Number
1. Book
Issued
2. Book Not
Issued
Questions:
1. Explain the major difference between structure and union in detail.
10.3 Write a C program for collecting and displaying employee details such as, Age, Name,
Address and Salary by using nested structure.
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Get the output as mentioned below:
Questions:
1. Explain how nested structure works in C programming.
11 11.1 Write a program to read the marks of 10 students for the subject CE143 Computer
concepts and Programming and computes the number of students in categories FAIL,
PASS, FIRST
CLASS and DISTINCTION using Pointers and Arrays.
Marks Categories
70 or above DISTINCTION
CE143 : Computer Concepts and Programming A.Y. :2021-22
69 to 60 FIRST CLASS
59 to 40 PASS
Below 40 FAIL
For example, if following marks of 10 students are entered:
34 56 78 98 12 31 67 75 91 23
Then the output should be
DISTINCTION 4 FIRST CLASS 1 PASS 1 FAIL 4
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
You are requested to gain all categories of results, so input the values accordingly, also
write the counts of all the categories.
#include<stdio.h>
void display();
int main()
{
void (*func_ptr)();
func_ptr=display;
printf("Address of functions display is
%u\n",func_ptr);
(*func_ptr)();
return 0;
}
void display()
{
puts("By helping others, we help overselves!!");
}
CE143 : Computer Concepts and Programming A.Y. :2021-22
12 12.1 Write a program to read a text file ‘Demo.txt’ and print each word of that file in reverse
order.
Expected Output:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Example:
Input: HELLO
Output: OLLEH
Questions:
1. Explain, why do we need to use files in C?
12.2 Write a C program that illustrates how to write into a file using putw() function and
how to read the same file using getw() function.
Use fopen(), fclose(), getw() and putw() functions.
Expected Outcome:
CE143 : Computer Concepts and Programming A.Y. :2021-22
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Enter the data in a file from console and retrieve that data on the console.
Also attach the screenshot of file where the data is written.
Questions:
1. Explain any 3 functions of file other then mentioned in the problem.
Sr. No. Function Purpose
12.3 Two files Data1.txt and Data2.txt contains list of integers. Write a program to produce
file Data3.txt which holds as merged list of these two lists. Use command line
argument to specify the file name.
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Enter the data in a file from console and attach the screenshots of Data1.txt, Data2.txt
and Data3.txt files. Also add the screenshot of console.
Questions:
1. Explain the difference between argc and argv along with their significance.
13 13.1 Write a program to read and print the student details using structure and Dynamic
Memory Allocation.
Following student details needs to be included:
Roll No., Name, Age, Class, Branch.
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Enter this student details for N number of students, collect the no. of details to be
entered from the user and ask for that many student’s details. Enter all details in below
mentioned table and print the values collected from user.
Roll
Sr. No. No. Name Age Class Branch
1.
2.
...
N.
Questions:
1. Explain the benefits of using dynamic memory allocation. Give one scenario
where it is most useful.
13.2 Write a program using a character string in a block of memory space created by calloc
CE143 : Computer Concepts and Programming A.Y. :2021-22
() and then modify the same to store a larger string using realloc () function. (Dynamic
Array).
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Enter the details in below given table as per the requirement:
Sr. No. Instruction Output
1. String to be entered
2. String received after reallocation of memory
Questions:
1. Mention advantage of using realloc() function.
13.3 Write a program to enter N numbers into array and find average. Enter the size of the
array through keyboard. (Dynamic Array). Use malloc () to allocate memory and
use free() to free the memory after the use.
Expected Outcome:
Draw flowchart, write algorithm and program for given scenario. Also attach screenshot
of output.
Enter the details in below given table as per the requirement:
Sr. No. Instruction Output
Enter the size of Array N (To be entered by user)
1. To be entered by user
2. To be entered by user
… To be entered by user
N. To be entered by user
Average of entered values