Professional Documents
Culture Documents
C Model Questions
C Model 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.
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...
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
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