C Programming - Assignment 1
C Programming - Assignment 1
2. What are the difference among the while, do-while & for loop. Explain with
example. 7
3. Write a program to check whether a given year is leap year or not leap year with
following condition – A year is leap year when – (i) it is divisible by 400. (ii) it is
divisible by 4 but not divisible by 100. 7
4. Write a C program to sum the sine series 7
5. Write a C program which accepts integer number and prints the sum of digits. 7
6. Write a C program to convert a decimal number (whole number) to Binary
System. 7
7. Write a C program to find roots of a Quadratic Equation 7
8. Write a program to display the following pattern called Floyed’s Triangle. 7
1
2 3
4 5 6
7 8 9 10
9. Write a C program to reverse the integer 7
10.Write a C Program to find whether a given number, n is prime or not. 7
11.Write a C program to print PASCAL triangle 7
12.Write a C program to find the sum of all integers between n1 & n2 that are
divisible by 3 & 7. The value of n1 & n2 should be taken from the user. 5
13.Write a C program to calculate GCD of two integers 5
14.Write a C program to calculate LCM of two integers 7
15.What do you mean by compile time error, run time error and logical error? 4
16.Write a program to find the factorial of a given number. 5
1
17.Write a C program to swap two numbers without using any temporary variables.
4
18.Write short notes on difference between looping & branching, difference between
unary & binary operator. 4 + 4
19.Write a C program to arrange a set of n numbers in ascending order. 7
20.Write a recursive program to compute the factorial of a number. 5
21.Write a recursive function to evaluate the Fibonacci series. 5
22.Write a C program to check whether a given string is palindrome or not. 5