You are on page 1of 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.

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

Write a program to enter the uppercase letter then convert the lowercase letter and vice versa 7.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 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. consumed units and amount paid by the customer. Write a program that reads an octal digits and display it’s corresponding binary value using else-if lader. 6. 5. .Enter meter number .previous.BAPATLA ENGINEERING COLLEGE: BAPATLA WORKSHEET-3 CLASS:1/4 B-TECH SUBJECT:C-Programming language 1.Write a program to perform arithematic operations by using SWITCH statement . 12. 2 . Consumed units Rate of Units(RS) 0-200 0.Write a program to find the given number is positive or negative. Write a program to find maximum number among 3 numbers.6 subjects of marks from the keyboard and calculate the total and average.65 per unit excess 401-600 230+0.Write a program to enter the student name .Write a program to print the given three numbers in ascending order. 11.00 per unit excess of 600 Print the meter number.code .Write a program to find the type of the roots whether those are real or imaginary.roll number . 4 Write a program to enter a character from the keyboard and then check whether the given character is vowel or consonant. present units then calculate total consumed units. Average Class >=70 distinction <=70 and >=60 first class <=60 and >=50 second class <=50 and >=35 third class <=35 fail 9.80 per unit excess of 400 >=600 390+1.50 per unit 201-400 100+0.Write a program to enter the employee number . 3 .Write a program to prepare electricity bill .

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

2. Write a program to read integer value using character and vice-versa. Write a program to find out whether the entered number is even or odd. Write a program to find sum of digits in a given number. 5. Write a program to find out whether the entered character is a vowel or a consonant. 6. Write a program to find the sum of n natural numbers. 11.BAPATLA ENGINEERING COLLEGE: BAPATLA WORKSHEET-4 CLASS:1/4 B-TECH SUBJECT:C-Programming language All the programs has to use conditional operators. 2. Write a program to find out whether the entered number is positive or negative. Write a program to find out whether the entered character is alphabet 8. do-while. 1. 1. or digit or special character. Write a program to decide the quadrant of an angle. Write a program to find out in which quadrant the given point lies. Write a program to find out maximum of three numbers. BAPATLA ENGINEERING COLLEGE: BAPATLA WORKSHEET-6 CLASS:1/4 B-TECH SUBJECT:C-Programming language All programs should use while. and for loops. 9. Write a program to convert grams into kilograms and inches to centimeters. 4. . 3. 10. 7. Write a program to find out whether the entered points are collinear or not.

Write a program to find whether the given number is a palindrome or not. Write a program to compute the sum of the first ‘n’ terms of the series (where n>=1 ) S=1-3+5-7+9. of –ve and +ve numbers in the set. Write a program to find given number is prime or not. SUBJECT:C-Programming language Write a program to count no. 2. 9. of lines. of lines in the given input. of characters in the given input. BAPATLA ENGINEERING COLLEGE: BAPATLA WORKSHEET-7 CLASS:1/4 B-TECH 1. 8. Write a program to find the geometric mean of ‘n’ numbers. 6. Write a program to print first n numbers Fibonacci sequence. Write a program to count the no. 8. 3. words. 5.3. 6. 4. Write a program to find image of a number. 0 1 1 2 3 5 8 13 21 34 55……. 9. Write a program to count no. 4.. 7. Write a program to find the factorial of the given number. and characters in the given input. 10. Write a program to read a list of numbers and make a count of the no. Write a program to find whether the given number is perfect or not (6=1+2+3). . which are not divisible by7 Write a program to compute GCD and LCM of the given two integers. Write a program to read n numbers and find even sum and odd sum. 5. 7. Write a program to find whether the given number is an Armstrong number or not. Write a program to print odd numbers between 1 and 100. Write a program to find the harmonic mean of ‘n’ numbers.

no. BAPATLA ENGINEERING COLLEGE: BAPATLA WORKSHEET-8 CLASS:1/4 B-TECH SUBJECT:C-Programming language 1. An array contains a max. 8. 2’s and 10’s are there. 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 to find the common elements in N1 and N2 and print them 4. Two given arrays N1 and N2 each contains different positive integers.Write a program to find how many 1’s . Write a program that checks whether the given string is palindrome or not. Write a program to find the largest and smallest in the given array of n elements. A one dimensional array A contains at most 25 elements. 6. 2. Write a program to find the second largest of the given number. print the elements of B three per line. print the elements in the reverse order 2 per line. Write a program that reads a set of integers removes the duplicates and prints them. Write a program to check whether the given integer is palindrome or not. of 25 elements each b/w 1’s and 10. Given the array of 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].10. 5. 11. 3. .

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