Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
7 views4 pages

C Assignment

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views4 pages

C Assignment

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Assignment

On
C programming language

1. Find sum of two integers


2. Find out the area and perimeter of a rectangle
3. Input three decimal numbers and find their sum and average.
4. Input two numbers and swap them.
5. Convert temperature in Celcius to temperature in Farenheit
6. Implement simple arithmetic calculator using user defined functions for each operation
(addition, subtraction,multiplication, division, modulus, exponent).
7. Check an integer whether it is odd or even
8. Find greatest of 3 integers
9. Find 2nd greatest of 3 integers
10. Input a number and find its absolute value.
11. Input a number and check whether it is odd or even and display accordingly
12. Solve a given quadratic equation. [Without imaginary roots].
13. To calculate the electric bill using following conditions:

UNIT AMOUNT
<=100 RS. 100/-
Next 50 unit Rs. 1/- per unit
Next 50 unit Rs. 2/- per unit
Above 200 unit Rs. 3/- per unit

14. Print 1 to 100


15. Print 100 to 1
16. Find Factorial of a number
17. Find sum of n natural numbers
18. Check whether a number is Prime or not
19. Input a number n and find:
i) Fibonacci series up to n
ii) The nth Fibonacci number
iii) First n Fibonacci numbers
20. Check whether a number is Perfect or not (A number is considered to e a Perfect
number if sum of factors of the number is equal to itself)
21. Check whether two numbers are co-prime or not.
22. According to the Gold Bach conjecture, every even number greater than two is
the sum of two prime numbers. Input an even number and decompose it into
two primes.
23. Find the sum of the digits of a number
24. Find the Reverse of a number
25. Check whether a number is Armstrong or not (A number is considered to e an
Armstrong numer if the sum of cubes of its digits is equal to the number itself)

26. Check whether a number is Krishnamurti or not (A number is considered to e a


Krishnamurti number if the sum of factorials of its digits is equal to the number itself)

27. Print the following pattern


i)

* ii) iii) * iv) *


** ***** ** * *
*** **** *** * * *
**** *** **** * * * *
***** ** ***** * * * * *
****** * ****** * * * * * *

28. Print the following pattern


i)
1 ii) 1
12 22
123 333
1234 4444
12345 55555
123456 666666

29. Print the following letters with 'star'(*)

X ii) N iii) Y iv) Z

30. Print the following order (odd positions- Fibonacci Series and even position- prime
numbers)

31. 2 1 3 2 5 3 7 5 11 8 13
32. Find the sum of 1st n prime numbers.
33. Input a number and check if it a Krishnamurthy number
34. Print the Non-Fibonacci series
n
35. Input the values of two variables n and r and calculate Cr

36. To input n numbers from user and display those.


37. To input n numbers and find their sum
38. To find the biggest of n input numbers and find its position
39. To input a list of numbers and search a particular number is present or not

40. Do the previous problem using binary search.


41. Find the factorial of anumer using function
42. To calculate nCr.
43. Draw the Pascal Triangle

1. 1
1 1
ii. 1 2 1
(b) 1 3 3 1

44. Find factorial of a number using recursion

45. Sum of n natural numbers using recursion

46. Find a^b using recursion

47. Print Fibonacci series using recursion


48. Input two numbers and find their GCD using recursion

49. Input two strings and concatenate them.


50. Input a string and reverse it.
51. Enter a sentence and find number of vowels, consonants, spaces and special characters
52. Check a string palindrome or not.
53. Find reverse of a string.

You might also like