Вы находитесь на странице: 1из 8

BAPATLA ENGINEERING COLLEGE: BAPATLA

WORKSHEET-1
CLASS: 1/4 B-TECH
SUBJECT: C Programming language
------------------------------------------------------------------------------------------------------------1. Write a program to display a line of text.
2. Write a program to display different types of data (integer, real, character).
3. Write a program to read two values and print their sum and difference .
4. Write a program to read two real values and perform all arithmetic operations
5. Write a program to compute the average of three integers and three real numbers.
6. Write a program to display the area and circumference of circle by reading the radius .
7. Write a program to find the area and perimeter of the following :
a) square
b) rectangle c) triangle.
8.Write a program to read the temperature in Fahrenheit (F0) and display it in centigrade.
9. Write a program to convert the time from hours to seconds.
10. Write a program to read two values in two variables and interchange their values using a third
variable.
11.Write a program to find simple interest and compound interest for certain period of time
reading the values of principal amount(P),time(T),and rate of interest(R).
12.Write a program to find the net salary for a given data:
Earnings:
D.A-----35%BASIC
H.R.A------15%BASIC.
Deductions: I.T-------10%BASIC
P.F---------5%BASIC.
13. Write a program to input the time in seconds and display it in hours , minutes and seconds .
14. Write a program to convert the given number of days into years ,months and days .
15. Write a program to read the roll number and three subject marks of a student and calculate
average marks .
16. Write a program to calculate the following by reading necessary values from the user.
a)ax+b/ax-b
b)2.5logx+cos32+|x2-y2|+2xy
c)(x2+y2-2xy)
d)ut+1/2at2
17. Write a program to print the ASCII values of the given character and vice versa.
18. Write a program to read an integer value using character variable and vice versa.
19. Write a program to input the character in upper case and convert it into lowercase.
20. Write a program to display hexadecimal and equivalent decimal numbers.

BAPATLA ENGINEERING COLLEGE: BAPATLA


WORKSHEET-2
CLASS: 1/4 B-TECH

SUBJECT: C Programming language

1. Write a program to interchange the contents of 2 variables by using a temporary variable.


2. Write a program to interchange the contents of the 2 variables without using the
temporary variable.
3. Write a program to determine distance of 2 points where the co-ordinates are given.
4. D=square root(x2-x1)2+(y2-y1)2
5. Write a program to determine sides of a triangle where the three points are given.
6. Write a program to find out real roots of a quadratic equation using the formula.
7. Roots = -b(+/-)sqrt(b2-4ac)/2a.
8. Write a program to find out the area of the triangle using the formula where three sides of
a
triangle are given.
Area=sqrt(s(s-a)(s-b)(s-c))
Where s=(a+b+c)/2 and s>a,b,c.
9. Write a program to find out the area of a triangle where three points are given:
(1/2)|x1(y2-y3)+x2(y3-y1)+x3(y1-y2)|.
10. Write a program to find out x1 and x2 values form the equations ax1+bx2=m
Cx1+dx2=n.
Where x1=(md-bn)/(ad-bc)
X2=(na-mc)/(ad-bc) where (ad-bc)>0.
11. Write a program to find out the compound interest using the formula:CI=p*(1+r/100)n.
12. Write a program to convert an upper case letter into a lower case letter and viceversa.
13. Write a program to convert inches into centimeters.

BAPATLA ENGINEERING COLLEGE: BAPATLA


WORKSHEET-3
CLASS:1/4 B-TECH

SUBJECT:C-Programming language

1. Write a program to find maximum number among 3 numbers.


2 .Write a program to print the given three numbers in ascending order.
3 .Write a program to find the given number is positive or negative.
4 Write a program to enter a character from the keyboard and then check whether the given
character is vowel or consonant.
5.Write a program to find the type of the roots whether those are real or imaginary.
6.Write a program to enter the uppercase letter then convert the lowercase letter and vice
versa
7.Write a program to enter any character from the keyboard and then check the given
character is alphabet or number or any special symbol using and without using library
functions
8.Write a program to enter the student name ,roll number ,6 subjects of marks from the
keyboard and calculate the total and average.
Average
Class
>=70
distinction
<=70 and >=60
first class
<=60 and >=50
second class
<=50 and >=35
third class
<=35
fail
9.Write a program to enter the employee number ,code ,basic salary and cadre then calculate
net
salary =Basic+DA+HRA-PF-IT
Code
Cadre
DA
HRA
PF
IT
1
Manager
25%
20%
5%
4%
2
Supervisor
15%
10%
4%
3%
3
Worker
5%
3%
2%
1%
10.Write a program to prepare electricity bill .Enter meter number ,previous, present units then
calculate total consumed units.
Consumed units
Rate of Units(RS)
0-200
0.50 per unit
201-400
100+0.65 per unit excess
401-600
230+0.80 per unit excess of 400
>=600
390+1.00 per unit excess of 600
Print the meter number, consumed units and amount paid by the customer.
11. Write a program that reads an octal digits and display its corresponding binary value using
else-if lader.
12.Write a program to perform arithematic operations by using SWITCH statement .

13. A cloth show room has announced the following seasonal discounts on purchase items.
Purchase Amount
discount
Mill cloth
handloom
0-100
-5%
101-200
5%
7.5%
201-300
7.5%
10%
Above 300
10%
15%
Write a program to compute the net amount to paid by the customer.
14.Write a program to that reads a decimal digit and display its corresponding binary value
using SWITCH statement.
15.Write a program that reads three vertices of a triangle and find the lengths of the sides and
print the type of the triangle (isosceles,equilateral ,scalene).
16.Write a program to caliculate x1=(md-nb)/(ad-bc), x2=(na-mc)/ad-bc) when ad-bc!=0
otherwise print error message.
17.Write a program to caliculate y=4x+100 if x<0, y=300 if x=40,y=4.5x+150 if x>40 using
conditional operator and if.
18.Write a program that reads values until you enter a negative value and display max and min
value.
19.Write a program to print image of the given number .
20.Write a program to compute the square root for 5 positive numbers.

BAPATLA ENGINEERING COLLEGE: BAPATLA


WORKSHEET-4
CLASS:1/4 B-TECH

SUBJECT:C-Programming language

All the programs has to use conditional operators.


1. Write a program to find out maximum of three numbers.
2. Write a program to find out whether the entered number is positive or negative.
3. Write a program to find out whether the entered number is even or odd.
4. Write a program to find out in which quadrant the given point lies.
5. or digit or special character.
6. Write a program to decide the quadrant of an angle.
7. Write a program to find out whether the entered character is alphabet
8. Write a program to find out whether the entered character is a vowel or a consonant.
9. Write a program to find out whether the entered points are collinear or not.
10. Write a program to read integer value using character and vice-versa.
11. Write a program to convert grams into kilograms and inches to centimeters.

BAPATLA ENGINEERING COLLEGE: BAPATLA


WORKSHEET-6
CLASS:1/4 B-TECH

SUBJECT:C-Programming language

All programs should use while, do-while, and for loops.


1. Write a program to find the sum of n natural numbers.
2. Write a program to find sum of digits in a given number.

3.
4.
5.
6.

Write a program to find image of a number.


Write a program to find given number is prime or not.
Write a program to read n numbers and find even sum and odd sum.
Write a program to print first n numbers Fibonacci sequence.
0 1 1 2 3 5 8 13 21 34 55..
7. Write a program to find whether the given number is a palindrome or not.
8. Write a program to find whether the given number is perfect or not (6=1+2+3).
9. Write a program to find the factorial of the given number.
10. Write a program to find whether the given number is an Armstrong number or not.

BAPATLA ENGINEERING COLLEGE: BAPATLA


WORKSHEET-7
CLASS:1/4 B-TECH
1.
2.
3.
4.
5.
6.
7.
8.
9.

SUBJECT:C-Programming language

Write a program to count no. of characters in the given input.


Write a program to count the no. of lines in the given input.
Write a program to count no. of lines, words, and characters in the given input.
Write a program to read a list of numbers and make a count of the no. of ve and +ve
numbers in the set.
Write a program to compute the sum of the first n terms of the series (where n>=1 )
S=1-3+5-7+9.
Write a program to print odd numbers between 1 and 100, which are not divisible by7
Write a program to compute GCD and LCM of the given two integers.
Write a program to find the geometric mean of n numbers.
Write a program to find the harmonic mean of n numbers.

10. Write a program to check whether the given integer is palindrome or not.
11. Write a program to find the second largest of the given number.

BAPATLA ENGINEERING COLLEGE: BAPATLA


WORKSHEET-8
CLASS:1/4 B-TECH

SUBJECT:C-Programming language

1. Given the array of elements, print the elements in the reverse order 2 per line.
2. A one dimensional array A contains at most 25 elements. Form a new array B with
intermediate elements being revaluated according to the formula
B(i)=1/3*(A[i-1]+A[i]+A[i+1]; print the elements of B three per line.
3. Two given arrays N1 and N2 each contains different positive integers, write a program to
find the common elements in N1 and N2 and print them
4. An array contains a max. no. of 25 elements each b/w 1s and 10.Write a program to find
how many 1s , 2s and 10s are there.
5. Write a program to find the largest and smallest in the given array of n elements.
6. Write a program to read a set of floating values terminated by 99 and print the avg and
print the number of values below avg.
7. Write a program that checks whether the given string is palindrome or not.
8. Write a program that reads a set of integers removes the duplicates and prints them.

BAPATLA ENGINEERING COLLEGE: BAPATLA


WORKSHEET-9
CLASS:1/4 B-TECH

SUBJECT:C-Programming language

1. Write a program to find whether a character string is a palindrome.


2. Write a program to delete all vowels from a sentence. Assume that the sentence is not
more than 80 characters long.
3. Write a program to count the number of words in a sentence.
4. Write a program which will read a line and squeeze out all vowels from it and output the
line with no vowels.
5. Write a program which will read a line and delete from it all occurrences of the word
the.
6. Write a program to encrypt a sentence using the strategy of replacing a letter by the next
letter in its collating sequence. Thus every A will be replace by B, every B by C and so on
and finally Z will be replaced by A. Blanks are left undisturbed.
7. Write a program to find matrix multiplication.
8. Write a program to find addition and subtraction of two matrices.
9. Write a program to find transpose of a given matrix.
10. Write a program to find trace of given matrix.
11. Write a program to find lower and upper triangular matrix.
12. Write a program to perform row wise sorting of a given matrix.

Вам также может понравиться