Sei sulla pagina 1di 5

Amrita School of Engineering

Amrita School of Engineering Coimbatore Programming in C Lab Questions Simple questions. 1. Print your address. 2. Find sum,difference,product,quotient and remainder. 3. Convert distance given in km to m. 4. Convert temperature given in Fahrenheit to Celsius. 5. Convert measurement given in feet to cms. 6. Find the square ,cube, squareroot of the given number. 7. Calculate simple interest. 8. Calculate compound interest. 9. Calculate the volume and surface area of a sphere. 10. Calculate the area of a triangle whose sides are given. 11. Convert the given character to uppercase. 12. Find the ASCII value of the given character. 13. Find the sum of digits of a 3 digit number. 14. Interchange the value of two variables . 15. Interchange the value of two variables without using a 3rd variable. 16. Calculate the displacement S,initial velocity u , acceleration a,time t, S=ut +1/2 at2 Conditional statements 1. Find the biggest of two numbers. 2. Find the smallest of two numbers. 3. Find the biggest of three numbers. 4. Check if a number is even or odd. 5. Check if a number is positive,negative or zero. 6. Check if a number is divisible by 7. 7. Check if a given character is vowel,number or any other character. 8. Change the case of the given alphabet. 9. Calculate the roots of a quadratic equation. 10. Convert the single digit number to words. 11. Calculate the grade of students whose rollno and 3 marks (each out of 100 ) are given. Grading is based on average mark. >=80 A

Amrita School of Engineering >=70 B >=60 C >=50 D <40 F 12. Implement a menu driven calculator. Loops 1. Print the Fibonacci series. 2. Check if a number is prime or not. 3. Find the sum of digits of a given number. 4. Find the reverse number. 5. Check if a given number is a palindrome. 6. Check if a given number is an Armstrong number. 7. Sum of natural numbers upto a limit. 8. Sum of even numbers upto a limit. 9. Sum of odd numbers upto a limit. 10. Find the factorial of a given number. 11. Generate the cosine series.1 - x2/2! + x4/4! + . 12. Convert the given number in binary to decimal. 13. Convert the given number in decimal to binary. 14. Print the given number in words eg. 21 two one. Nested Loops 1. Find the prime number between two limits. 2. Generate the pattern 1. 1 2 3 1 2 4 2. 2 3 3 4. 3 5 0 6 1 0 * * * 1 1 1 * *

3.

ARRAYS 1. Read and print an array of n elements. 2. Find the sum of two arrays. 3. Insert an element to the array.

Amrita School of Engineering 4. Delete an element from the array. 5. Split the array into two arrays one containing odd numbers and the other even numbers. 6. Find the number of occurrences of an element in an array. 7. Find the biggest and smallest of the given array. 8. Find the second smallest of the given array. 9. Sort the array in ascending order. 10. Read and print a two dimensional array. 11. Find the sum of diagonal elements of the matrix. 12. Print the upper triangular matrix. 13. Print the lower triangular matrix. 14. Sum of two matrices. 15. Transpose of a matrix. 16. Product of two matrices. 17. Write a menu driven program to convert to binary,octal or hexadecimal. 18. Print the Pascals triangle. Strings Read and print your address. Find the length of a string. Copy the given string to another string. Combine the given string with another. Find the reverse of a given string. Check if a given string is a palindrome or not. Find the no: of vowels, consonants and numbers in a given string. Find a string in another string. Write a menu driven program to i. Find the length of a string ii. Join two strings iii.Reverse a string iv. Compare two strings. v. Find a string in another string. Using string functions. 10. Sort the given names in alphabetical order. 1. 2. 3. 4. 5. 6. 7. 8. 9. Structures 1. Read and print the details of a student rollno,name,age and mark of three subjects. Calculate total and average. 2. Read and print the details of n employees empcode,name,age and basicpay .Calculate da=39 % of basicpay,hra= 10 % of basicpay,deductions=5% of basicpay, total=basicpay+da+hra,net=total-ded.

Amrita School of Engineering Arrange the employees according to their salary. 3. Find tomorrows date ,given todays date. 4. Calculate age of a student name and date of birth given. Functions 1. Implement a menu driven calculator using functions. 2. Find the sum and product of two matrices. For reading and printing matrix use functions. 3. Calculate factorial using recursive functions. 4. Generate Fibonacci series using recursive functions. 5. Find the largest element in an array using recursive functions. Pointers 1. 2. 3. 4. 5. Find sum of two numbers using pointers and print the values and addresses. Using pointers compare two strings. Sort an array using pointers. Find the sum of two matrices using pointers. Read and print the details of a student rollno,name,age and mark of three subjects using pointers . Calculate total and average. 6. Read and print the details of n students rollno,name,age and mark of three subjects. Calculate total and average.Arrange them in the descending order of marks. Find the student who scores highest.(using pointers).

Amrita School of Engineering

Potrebbero piacerti anche