Sie sind auf Seite 1von 4

LAB ASSINGMENT ON C (Basic operation)

1. WAP to display your Name and Address. 2. Enter two numbers from keyboard. WAP to add, subtract, multiply and divide them and generate their remainder. Display the results. 3. WAP to calculate the average of three numbers entered through the keyboard. 4. WAP to calculate the simple interest of an amount A, for a particular period T and with the interest rate R and display the result. 5. WAP to calculate the circumference and area of a square and display it. 6. Do the same thing for a rectangle. 7. WAP to convert a temperature of a Celsius scale to the temperature in a Fahrenheit scale. 8. WAP to convert a temperature of a Fahrenheit scale to the temperature in a Celsius scale. 9. WAP to swap two numbers using any third variable. 10. WAP to swap two numbers without using any third variable.

(If-Else and conditional statement)


11. WAP to compare two numbers entered through the keyboard and print which is greater. 12. WAP to compare three numbers entered through the keyboard and print which is greater. 13. WAP to check whether a number is odd or even. 14. WAP to check whether a year entered through the keyboard is leap year or not. 15. In a company an employee is paid like this: If basic is less than 5000, then DA=70% of basic and HRA=10% of basic. Else DA=75% of basic and HRA=1000. WAP where user will enter the basic of the employee and calculate and display the salary of the employee. Total salary=Basic+DA+HRA 16. The marks obtained in five different subjects are entered through keyboard. The students get a division as per the following rule i) First Division: if percentage is above or equal to sixty ii) Second Division: if percentage is between 50 and 59 iii) Third Division: If percentage is between 40 and 49 iv) Fail if percentage less than 40 WAP where user will enter the marks of different subjects and the division will be displayed. 17. WAP to calculate the roots of a quadratic equation in the form ax2 + bx +c = 0 18. WAP using conditional operator to determine whether a year is leap year or not. 19. WAP using conditional operator to find the largest number among 4 integer numbers.

(Switch statement)
20. WAP using switch statement to check whether a number is odd or even. 21. WAP to carry out the arithmetic operations addition, subtraction, multiplication, and division between two variables using switch statement. 22. WAP that checks whether a character entered by user is vowel or not using switch statement. 23. WAP to find out the status of the roots and roots of a quadratic equation (ax2 + bx + c=0) using switch statement.

(While and Do-While statement)


24. WAP to find the sum of n integers using while and Do-while loop. 25. WAP to find the sum of digits of a number using While and Do-while loop. 26. WAP to print the reverse of a number and check whether it is palindrome or not. . 27. Find the greatest common divisor(GCD) and Least Common Multiplier(LCM) of two integers. 28. WAP to find the factorial of n. 29. WAP to check whether a number is Armstrong number or not. (A number is Armstrong if it equals the sum of cubes of its digits. Let 153=(1*1*1)+(5*5*5)+(3*3*3) 30. WAP to print the first n Fibonacci numbers.

(For statement)
31. WAP to print numbers from 1 to 100 using for loop. 32. WAP to find the numbers divisible by 7 between 100 to 200. 33. WAP to add numbers from 1 to 20 using for loop. 34. Calculate the sum of n prime numbers. N will be provided by the user. 35. WAP to print the following pattern using nested for loop. 55555 4444 333 22 1

36. WAP to print the following pyramid. * * * * * * * * * * 37. WAP using nested for loop to print the following pyramid * * * * * * * * * * * * * * * * 38. WAP to print the following pyramid. 1 121 12321 1234321

(ARRAY)
39. Declare a one dimensional array of 10 elements. Enter elements from keyboard and print the array in forward and reverse direction. 40. Enter the marks of a student in 5 different subjects using array. Calculate the sum and average marks of the student. 41. WAP to find the largest and smallest number among n numbers. 42. WAP to find the location of an element in an array .(linear search) 43. WAP to sort n elements in ascending order.(Bubble Sort) 44. WAP to declare a two dimensional array of 4 rows and 3 columns. Enter the elements into it and print the array. 45. WAP to add two matrices of m x n and print the result. 46. WAP to multiply two matrices. 47. WAP to transpose a matrix.

(FUNCTION)
48. WAP to print Haldia Institute Of Technology using a function. 49. WAP to add two numbers using a function. 50. WAP to swap two variables using a function and demonstrate call by value and call by reference 51. WAP to calculate factorial of n using a function. 52. WAP using function to calculate the sum of the elements of an array (array will be passed to the function) 53. WAP to calculate nCr. 54. WAP to calculate factorial of n using recursion. 55. WAP to print n Fibonacci numbers using recursion. 56. WAP to calculate GCD of two numbers using recursion.

( STRING)
57. WAP to read a line of text using getchar() function. And display it. 58. WAP to take a line of text from keyboard and display it using putchar() function. 59. WAP to read a character from keyboard and then prints it in reverse case. That is, if the input is Upper case ,the output will be Lower case and vice versa. 60. WAP which would print the alphabet set a to z and A to Z in decimal and character form. 61. WAP to find the length of a string without using string function. 62. WAP to concatenate two strings without using string function. 63. WAP to copy one string to another without using string function. 64. WAP to compare two strings whether they are equal or not. 65. WAP to reverse a string with out using string function and check whether it is palindrome or not. 66. WAP to read a set of strings from keyboard and display on monitor. 67. WAP to sort a set of strings in alphabetical order. (POINTER) 68. WAP to add two numbers using pointers. 69. WAP to swap two variables using function.(call by value and call by reference) 70. Using pointer Write a program to find out the length of the given string with out using strlen() function.

(STRUCTURE)
71. WAP to create a structure Employee having three fields name, age and salary. Read a record of an employee from keyboard and display it.

(FILE)
72. WAP to create a file and input some value 73 WAP to copy some content from a file to another file 74 WAP to copy some content from a file to another file taking file name as command line argument.

(Dynamic memory allocations)

Das könnte Ihnen auch gefallen