Assignment 1 :-
Q1 - Write a C Program to perform the following operations on any integers.
Get the integer values from the user.
1. Addition
2. Subtraction
3. Multiplication
4. Division
Q2 – Write a C Program to read and display the following information of a student.
Name, Age, Course, Department, City, Marks in 12th board exam.
Q3 – Write a C Program to swap two numbers with and without 3rd variable.
Q4 – Write a C Program to find x^y^z without using any library function.
Q5 – Find the roots of a quadratic equations using
[-b + √(b^2 – 4ac)]/2a
[-b - √(b^2 – 4ac)]/2a
Take the values of a,b,c from uses.
Q6 – Write a C Program to find if a number taken from user is odd or even.
Q7 – Write a C Program to find the greatest among three numbers taken from user.
Q8 – Find the area of Triangle, Square, Rectangle and Circle. Sides/Radius of the shapes are to
be taken from user.
Q9 – Write a menu driven C program to calculate the area of the following using macro:
• Circle
• Square
• Rectangle
Q10 – Write a C program to swap two integers using macro.
Q11 – Write a C program to find the factorial of an integer using a user defined function.
Q12 – Write a C Program to display the Fibonacci series using defined function.
Take the range value as a user input.
Q13 – Write a C program to find and print all Prime Numbers within a given range.
Q14 – Write a C program to find all Fibonacci Numbers up to n.
Q15 – Find the value of the following series.
Y = 1 – (√2 / 2!) + (√3 / 3!) - (√4 / 4!) + (√5 / 5!) -…………………… (√n / n!)
Q16 – Print Diamond pattern.
Q17 – Write a C program to find the sum of all digits of a given integer.
Q18 – Write a C program to check weather the given number is a Palindrome or not.
Q19 – Write a C program to find the Sum, Average, Minimum and Maximum elements in an
1D-Array. Write function for each operation.
Q20 – From two 1D sorted array A and B make another sorted array C with all the elements
in A and B.
Q21 – Write a C program to find an element in an array using linear search.
Q22 – Sort an integer in 1D-Array using Bubble Sort.
Q23 – Write a C program to perform Addition and Multiplication of two 2D-Array.
Q24 – Write a C program to print all Armstrong numbers between 1 to 500.
Q25 – Write a c program to find all the Krishnamurthy numbers from m to n where value of m
and n are taken from user.
Q26 – Write a C program to take a number from user with its base. Convert it in its output base
taken from user. (Base : Binary, Octal, Decimal, Hexadecimal)
Q27 – Write a C program to print Pascal’s Triangle up to n rows: 1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
Q28 – Write a C program to create an array of integers and display.
Q29 – Write a C program to insert an element at any position in an array and display position to
be taken from user.
Q30 – Write a C program to delete an element from any position in an array and display.
Position to be taken from user.
Q31 – Write a C program to search an element in an array and show the position where it is
found.
Q32 – Write a C program to sort an array of integers in ascending order.
Q33 – Write a C program to find reverse of a number.
Q34 – Write a C program to print the following Pattern up to n rows : 1
2 3 2
3 4 5 4 3
4 5 6 7 6 5 4
5 6 7 8 9 8 7 6 5
Q35 – Write a C program to convert string in sentence casein upper case.
Q36 – Write a C program to check whether a string is palindrome.
Q37 – Write a C program to concatenate two strings.
Q38 – Write a C program to compare two string without library function.
Q39 – Write a C program to compare two string. If they are not same, copy 2 nd string to 1st one.
Q40 – Write a C program to delete all occurrences of a particular word from a sentence.
Q41 – Write a C program to start a 2D-Array of characters in alphabetical order.
Q42 – Write a C program to swap two numbers using pointer :
i – Call by Value
ii – Call by Reference
Q43 – Write a C program to sort an array using pointer.
Q44 – Write a C program to add the elements of an array using pointer.