Assignment II - Basic 'C'

Assignment II


Write a ‘C’ program to calculate the sum of factors of anumber.


Write a recursive function in ‘C’ to calculate factorialof a number. Use this function in main.

 

Write a function in ‘C’ to reverse an integer. Use thisin main

 

Write a function in ‘C’ to calculate sum of digits of aninteger. Use this function in main.


Write a ‘C’ program to display n terms of the Fibonacciseries.

 

Write a ‘C’ function to check if a number is prime. Use this function to display all prime numbers between 100 and 500.

 

Write a ‘C’ program to display n lines of the following pattern.

1

2 3

4 5 6

 

Write a ‘C’ program to calculate the GCD of two numbers.

 

Write a ‘C’ program to accept real number x and integer n and calculate the sum of first n terms of the series  x+ x/3!+ x/5!+ x/7!+...

 

Write a ‘C’ function to calculate xy. Use this function to calculate the sum of first n terms of the series   x + x3/3 + x5/5 + ....

 

Write a ‘C’ program to accept a character and check if itis alphabet, digit or special symbol. If it is an alphabet, check if it isuppercase or lowercase.


Write a ‘C’ program to check whether the given year is leap year or not.

 

Write a ‘C’ program to check if a number is perfect (number = sum of its factors)




Comments

Popular posts from this blog

Write a program to allocate memory dynamically for n integers. Accept the elements and calculate their sum and average

C program to accept names of n cities and search for city named “Pune”.