C Program Solution

Coming soon...






6. Write a program to read a list of positive integers terminated by -1 and display the odd and even numbers separately and also their respective counts. 

7. Write a program to read values of n and x and print the value of y using switch case where a. y=n+x when n=1 b. y=1+x/n when n=2 c. y= n+3x when n=3 d. y=1+nx when n>3 or n<1. 

8. Write a program to n values of sales and then calculate the commission on sales amount where the commission is calculated as follows: a. If sales <= Rs.500, commission is 5%. b. If sales > 500 but <= 2000, commission is Rs 35 plus 10% above Rs 500. c. If sales > 2000 but <= 5000,commission is Rs 185 plus 12% above Rs.2000. d. If sales > 5000 ,commission is 12.5%. 

9. Write a program to find out minimum, maximum, sum and average of n numbers without using array. 

10. Program to find mean and standard deviation (SD) for a set of n numbers without using array.

11. Write a program to find out the roots of a quadratic equation. Use proper testing to find checks for real and complex roots.

12. Write a program to print the digits of a number in words. ( eg. if a number 841 is enteredthrough the keyboard your program should print “Eight Four One”.)

13. Write a program to print the PASCAL Triangle up to the n-th row where n is an input to the program.

14. Write a function to return the HCF of two positive integers. Write a main function to read two positive integers and print their HCF and LCM by using the above function.

15. Write a program to convert a decimal number into binary number using function.

16. Write a program to display the result of sine series using function.

17. Write a program to find the sum of the following series 1+x-x^3/3!+x^5/5!-x^7/7!+ . . . . . corrected up to the 3 decimal place.

18. Write a program to read n numbers in a sorted array and insert a given element in a particular position

19. Write functions to compute the factorial of a number using both recursive and non-recursive procedure.

20. Write a program to print the values of n cr and n pr for given positive integers n> r > 0. Use a function fact(n) to return the factorial of a non-negative integer.n. n cr=n!/r!*(n-r)! n pr=n!/(n-r)!

21. Write a program to display the first n Fibonacci numbers using function.

22. Write a program to display the prime numbers within a given range. Write a function to check whether a given integer is prime or not and use it.

23. Write a program to Multiply two matrices using function

24. Write a program to display the upper Triangle and lower Triangle of a given square matrix using function.

25. Write a function to check if a given square matrix is symmetric or not. Write a main function to implement it.

26. Write a program to read a m X n matrix and calculate the Row sum and Column Sum of the matrix

27. Write a function to read in an integer and print the representation of the number using the sign and magnitude representation scheme using 8 bits. The program should check for overflow/under flow conditions. The left most bit is to be used as the sign bit.

28. Write a program to merge two sorted arrays.

29. Write a program to implement selection sort using function.

30. Write a program to count the number of vowels in a string.

31. Write a program to concatenate two strings using function (without using library function).

32. Write a program to convert a string from upper case to lower case and vice versa.

33. Write a program to swap two numbers using function (pass the pointers).

34. Write a program to sort n number of strings in ascending order using pointer.

35. Write a program using pointers to copy a string to another string variable (without using library function).

36. Declare a structure of a student with details like roll number, student name and total marks. Using this, declare an array with 50 elements. Write a program to read details of n students and print the list of students who have scored 75 marks and above.

37. Create a structure to store the following information of employees. a. Employee‟s number, name, pay and date of joining.It has been decided to increase the pay as per the following rules: Pay <= Rs.3000 : 20% increase Pay <= Rs.6000 but > Rs.3000 :15% increase Pay > Rs.6000 : no increase Write a program to implement the above structure.

38. Write a program to read a text file and count the number of vowels in the text file.

39. Write a program to copy a text file to another file.

3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete