Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

C PROGRAMMING MODEL PRACTICALS QUESTIONS

1) Write a program the numbers are amicable or not if the number amicable print yes if the
number not amicable print no
Example - the given two numbers are said to be amicable 15,25. 1+2+3+4+5 is equal to
15 and 1+3+5+6+10 is equal to 25.

2) Write a c program to calculate monthly EMI ,total interest,repaid amount


Also calculate the monthly EMI for mr.X & Mr.Y
Formula will be given in the question paper.

3) Write a program to create a file ALPHABETS.txt and get input of set of words from the
user and print it in the file . Then find the longest word from the input and display the
length of words
Sample input:
Enter no of words:2
Robot
Bitcoin
Sample output:
Longest word: Bitcoin
Length of the word: 7

4) Write a prog to get 5 words as input and reverse them using user defined function by
passing character pointer and display the reversed word

5) Create a file and print all the alphabets from A to Z and derive the output for the
following using fseek() ftell() rewind()
i)print all the letters from a to z
ii) print all the letter in even index(consider the starting index as 0)
iii) print the third consecutive letters in series(consider the starting index as 0)
Eg:ADGJM...

6) Mr X is addicted to gambling.Everyday he loss RS.L more than what he lost on the


previous day but RS was lost only on the first day of the month RS.F.Taking L and F as a
input and print the output of total loss ,total amount from Day 2 and calculate for Day D
of the month.

7) Write a c program to print the pattern.

8) Write a c program to Find Adam's Number .

9) Write a c program to print


a,digit count b, count even number c, count odd number d,sum even digit e,sum odd
digit
C PROGRAMMING MODEL PRACTICALS QUESTIONS

10) Write a c program to read a line string and print:


1.number of vowels
2.number of constants
3.number of lowercase letters
4.number of uppercase letters
5.number of spaces

11) Write a c program to accept a 2d array which should replace the diagonal element with
the value of zero. Create a user defined function with pointer to an array which accept 2d
array as a parameter and apply logic as given.Print the original array and the replaced
array

12) To read a empno name designation and salary of the employee and to find the files of
EMPLOYEE TXT and READ file this is my program

13) Get a 5 words from user, to convert small letters in the word to capital letter and capital
letter in the word to small letter using user defined function

14) P,q, r,s go to restaurant


Chicken gravy- 120
Veg gravy -70
Rotti-20
Naan-10
P person buy chicken gravy-
q person buy veg gravy - r person buy rotti
S person buy naan
15) To write a c program to calculate total cost for the buying food items
(Hint: use a structure to store a item)

16) 2d array Matrix change the diagonal element using create function

17) Write a c program to array of an integer using a pointer , get one element from the user,
copy the new elements from original elements to new elements without that number and
print the elements. Example:input No of elements : 9 11 22 33 44 55 66 77 88 99
Enter a number to remove:88 original array :11 22 33 44 55 66 77 88 99
New array:11 22 33 44 55 66 77 99

18) Min and Max sum and reverse it

You might also like