Sie sind auf Seite 1von 5

Structure Programming Language Sessional

Lab Manual

Week Practical list Remarks


1. Write a C program to print “Hello world”
2. Write a C program to enter two numbers and find their sum.
3. Write a C program to enter two numbers and perform all
arithmetic operations.
4. Write a C program to enter length and breadth of a rectangle and
Week-1
find its area.
5. Write a C program to enter radius of a circle and find its
diameter, circumference and area.
6. Write a C program to enter length in centimeter and convert it int
o meter and kilometer.
1. Write a C program to convert centigrade int o Fahrenheit.
Formula: C= (F- 32)/1.8.
2. Write a C program to convert days int o years, weeks and days.
3. 4. Write a C program to enter any number and calculate its square
root.
4. Write a C program to enter marks of five subjects and calculate
total, average and percentage.
5. Write a C program to read in a three digit number produce
Week-2 following output (assuming that the input is 347) 3 hundreds 4
tens 7 units
6. Write a C program to read in two int egers and display one as a
percentage of the other. Typically your output should look like 20
is 50.00% of 40 assuming that the input numbers where 20 and
40. Display the percentage correct to 2 decimal places.
7. Write a C program to find out whether the character presses
through the keyboard is a digit or not (using conditional operator).
8. Write a C program to swap variable values of i and j.
1. Write a C program to find the maximum from given three nos.
2. Write a C program to find that the accepted no is Negative,
Positive or Zero.
3. Write a program which reads two int eger values. If the first is
lesser print the message up. If the second is lesser, print the
message down if they are equal, print the message equal if there
Week-3 is an error reading the data, print a message containing the word
Error.
4. Write a C program that print s the given three int egers in
ascending order using if – else.
5. Given as input three integers representing a date as day, month,
year, print the number day, month and year for the next day's
date. Typical input: “28 2 1992” Typical output: “Date following
28:02:1992 is
29:02:1992”.
1. Write a C program for calculator designing using switch /case
loop?
2. Write a C program to convert decimal to binary.
Week-4
3. Write a C program to convert decimal to octal.
4. Write a C program to convert decimal to hexadecimal.
5. Write a C program to find the sum of first 100 natural nos.
1. Write a C program to find the sum of first 100 odd nos. and even
nos.
2. Write a C program to display first 25 Fibonacci nos.
3. Write a C program to display first 100 prime nos.
4. Write a C program to find factorial of accepted nos.
5. Write a C program to find the sum of digits of accepted no.
Week-5
6. Write a program in C that will scan a number N and then output
the sum of the powers from 1 to N. thus, if the input is 4, the
output should be 288 bec. 1+4+27+256=288 [1,2,3,4]
7. Write a program in C that accepts dates written in numerical form
and then output them as a complete form. Sample input: 2 26
1986 Sample output: February 26, 1986.
1. Write C programs for the following operation to work like DOS
Commands: a. type abc.txt b. copy source1.txt source2.txt c.
copy source1.txt source2.txt source3.txt source4.txt d. compare
source1.txt source2.txt e. concat source1.txt source2.txt
2. Write a C program to open two files containing int egers (in
sorted order) and merge their contents.
Week-6
3. Write a C program to count the number of vowels, consonants,
digits, spaces, other symbols, words and lines in a given text file.
4. Write C code to check if an int eger is a power of 2 or not
5. Write a C program to count bits set in an int eger?
6. Write a C program to set a particular bit in a given number.
7. Write a C program to reset a particular bit in a given number.
1. Write a C program to check Least Significant Bit (LSB) of a
number is set or not.
2. Write a C program to get nth bit of a number.
3. Write a C program to toggle nth bit of a number.
4. Write a C program to get highest set bit of a number.
5. Write a C program to input any decimal number from user and
Week-6
convert it to binary number system using bitwise operator.
(array and loop)
6. Write a C program to input any two numbers from user and
swap values of both numbers using bitwise operator. How to
swap two number using bitwise operator in C programming.

1. Write a C program to print all natural numbers from 1 to n. -


Week 7
using while loop
2. Write a C program to print all even numbers between 1 to n
3. Write a C program to print the sum of all odd numbers from 1
to n using for loop.
4. Write a C program to count number of digits in any number.
5. Write a C program to enter any number and find the sum of
first and last digit of the number using for loop.
6. Write a C program to swap first and last digits of any number.
7. Write a C program to enter any number and print its reverse.
8. Write a C program to enter any number and check whether the
number is palindrome or not.
9. Write a C program to print ASCII values of all characters
using for loop.
10. Write a C program to enter any number and calculate its
factorial.

1. Write a C program to find HCF (GCD) of two numbers.


2. Write a C program to find LCM of two numbers.
3. Write a C program to check whether a number is Prime number
or not.
4. Write a C program to find sum of all prime numbers between 1
Week 8 to n.
5. Write a C program to check whether a number is Armstrong
number or not.
6. Write a C program to print Fibonacci series up to n terms.
7. Write a C program to convert Binary to Octal number system.

1. Write a C program to print day of week name using switch


case.
2.
3. Write a C program to find maximum between two numbers
using switch case.
4. Write a C program to find to print following ways

1 1 12345 *
Week 9
22 10 2345 **

333 101 345 ***

4444 1010 45 ****

*
55555 *****
10101 5 *****

** *****

*** *****

**** *****

***** *****
1. Write a C program to read and print elements of array.
2. Write a C program to find sum of all array elements. - using
recursion.
Week 10 3. Write a C program to find maximum and minimum element in
an array. - using recursion.
4. Write a C program to insert an element in an array.

1. Write a C program to add two matrices.


2. Write a C program to multiply two matrices.
3. Write a C program to find sum of each row and column of a
Week 11
matrix.
4. Write a C program to find determinant of a matrix.
5. Write a C program to print all unique elements in the array.
1. Write a C program to find length of a string.
2. Write a C program to copy one string to another string.
3. Write a C program to compare two strings.
4. Write a C program to convert lowercase string to uppercase.
Week 12 5. Write a C program to find total number of alphabets, digits or
special character in a string.
6. Write a C program to search all occurrences of a word in given
string.

1. Write a C program to find cube of any number using function.


2. Write a C program to find diameter, circumference and area of
circle using functions.
3. Write a C program to find sum of elements of array using
Week 13 recursion.
4. Write a C program to find power of any number using
recursion.
5. Write a C program to find all prime numbers between given int
erval using functions.
Week 14 LAB Test
Week Remarks
Week-1

Week-2

Week-3
Week-4
Week-5
Week-6
Week-6
Week 7
Week 8
Week 9
Week 10
Week 11
Week 12
Week 13
Week 14

Das könnte Ihnen auch gefallen