how to practice C Questions

HOW TO  PRACTICE C Questions

with the help of this block, we are providing the  day by day Questions . this questions is level up day by day.


C introduction(Day 1 & 2 )  


1) What is programming language? Describe various categories?
2) Differentiate between compiler and interpreter.
3) Describe features of C language?
4) What is platform dependency?
5) Explain C program Compilation & Execution Process for Window and Ubuntu platform?   

Data type Variable, Literals, Input, Output, 
#define Operators(Day 3 & 4)  


6. Explain C Tokens?
7. Write a program to calculate square of a given no?
8. Write a program to swap using third variable?
9. Write a program to swap without using third variable.
10. Write a program to calculate area of Triangle.
11. Write a program to calculate area of Circle.
12. Write a program to calculate Simple Interest.
13. Write a program to convert distance from KM to MM.
14. Write a program to calculate average of three numbers.
15. Write a program to calculate temperature conversion from Celsius to Fahrenheit (F= (9/5) C+32) 16. Write a program to calculate temperature conversion from Fahrenheit to Celsius. (C= (F- 32)5/9) 17. A cashier has some amount of money(e.g. rs4526).Write a program to calculate out how many currency of Rs1000, Rs500, Rs100, Rs50, Rs20, Rs10, Rs5, Rs2, Rs1 required.
18. Write a program that accepts four digit number from user and calculate the sum of first and last digit.
19. Write a program that accepts marks of five subjects from user and calculate the total marks and then calculate the percentage out of 500?
20. Write a program that accepts a character from user and print its ASCII value?
21. Write a program that accepts a three digit number from user and obtain reverse of the number and then calculate sum of all the digits.(without using if/ loop)
22. Write a program that accepts a numeric value from user and print its corresponding character?
23. Write a program to calculate gross salary and net salary. Accept basic salary from user,  TA(Travel Allowance) i.e 10% of basic salary, PF(Provident Fund) i.e 7.8% of basic , DA(Dearness Allowance) is 500. gs=basic+da+ta; ns=gs-pf;


If, If-else(5-6-7 days) 


24. Write a program that accepts a number from user and calculate whether it is positive or negative or zero?
25. Write a program to calculate first number is divisible by second or not? 
26. Write a program that accepts a three digit number from user and check whether it is palindrome or not? 
27. Write a program that accepts a three digit number from user and check whether it is Armstrong or not.(eg. 153= 13+53+33) 
28. Write a program that accepts a three digit number from user and find the greatest digit in it. 
29. Write a program to calculate whether year is leap year or not? 
30. Write a program to calculate whether a character is vowel or consonant. 
31. Write a program to calculate whether character is in lowercase or uppercase. 
32. Write a program to calculate smallest number out of given three numbers. 
33. Write a program to calculate largest number out of given four numbers. 
34. Write a program to accept basic salary from user, if basic salary is between 0 and 10000 then TA is 10% of basic salary, DA is 5% of basic salary. If salary is above 10000 then TA is 12% of basic salary, DA is 6% of basic. Now calculate gross salary as gs=basic salary+TA+DA?
35. Write a program to calculate Area and perimeter of Rectangle then calculate which one (out of area and perimeter) is greater. 
36. Write a program that accepts marks (out of 100) of five subjects from user and calculate the sum then calculate percentage? Display message according to following condition percentage >=60 Grade A percentage >=50 Grade B percentage >=40 Grade C percentage  <40 Grade D
37. Write a program for generating electricity Bill. Accept last month unit and current month unit from user, then calculate and print bill amount according to following condition For units  0-100 charges 2 rs/unit 101-200 charges 3rs/unit 201-300  4rs/unit >300 charges 5rs/unit
38. Write a program to enter three subject marks (out of 100). Check if student is pass or Fail, only  if he/she scores greater than 75 in each subject and the average of all three subject marks should also be greater than 80.
Switch case (Day 8) 
39. Write a program to calculate area of different Shapes based on users choice S, C or R (like s for square, c for circle, and r  for rectangle).
40. Write a program to show day of week according to user input. 41. Write a program to check if entered character is vowel or not.
42. Write a program to check whether a number is even or odd using switch-case.
While, do-while and for Loop
(Day 9 & 10, & 11)  


43. Write a program to calculate Factorial of any number. 
44. Write a program to print table of any number.  
45. Write a program to print Fibonacci Series. 
46. Write a program that accepts n number from user and calculate Maximum and Minimum value. 47. Write a program to calculate sum of squares of n natural number. 
48. Write a program to calculate sum of series (1/1+1/2+1/3+1/4+.....). 
49. Write a program to calculate sum of series (1/1! + 1/2! + 1/3! + 1/4! +.....) 
50. Write a program to calculate sum of digits of a number. 
51. Write a program to check whether a number is Armstrong or not. 
52. Write a program to find factors of any number. 
53. Write a program to calculate number entered is a perfect Number or not (sum of factors of a number is the number like 6). 
54. Write a program to accept n number from user and show how many numbers are even or odd. 
55. Write a program to find LCM of two numbers. 
56. Write a program to find HCF of two numbers. 
57. Write a program to calculate number is prime or not.   
Nested loops (Day 12 & 13)
 58. Write a program to print prime numbers from 1 to 1000. 59. Write a program to print Armstrong numbers from 100 to 999. 60. Write a program to calculate sum of first 10 even numbers. 61. Write a program to convert decimal number to binary number. 62. Write a program to print table for numbers between 2 to 10. 
63) Write a program to print following patterns on screen
*
 * *
 * * *
 64)
 *
 * * *
 * * * * *
65)
       123
       456
       789

66)
 5
 54
543
5432
54321

67)

 1
 12
 123
 1234

68)
 A
 AB
 ABC
 ABCD
 ABCDE

69)
ABCDDCBA
 ABCCBA
 ABBA
 AA

70)
 *
 * *
 * * *
 * * *
 * *
 *

71) // Pascal triangle
        1
       1 1
      1 2 1
    1 3 3 1
   1 4 6 4 1
Function and Pointers(Day 14, 15, 16)  
72. What is a function and define its types?
73. Write a program to calculate factorial using function with return type and argument?
74. Write a program to check the prime number using function with argument and return type?
75. Write a program to display below pattern using function with number of rows in pattern as argument?
5 4 3 2 1
 4 3 2 1
 3 2 1
 2 1
 1

76. Calculate ab using function with a and b as arguments and return result;
77. What is pointer and explain its working?
78. Write difference between call by value and call by reference?
79. Pass address of an integer variable to a void function and double the value of variable.
80. Pass three integer variables to function using call by reference mechanism and store sum of two into third variable.
Arrays (Day 17, 18, 19)  
81. What are array and its type?
82. Write a program to store 10 numbers in array and calculate its sum and average?
83. Write a program to find maximum element in array.
84. Write a program to reverse elements in array? (last element go to first position and vice-versa)
85. Write a program to sort array in descending order?
86. Write a program to calculate the number of occurrence of given no. in array using function with array and number as argument?
87. Write a program to merge two arrays in third array.
88. Write a program to find Second highest no. in array?
89. Write a program to Input two 3 X 3 Array and perform below operation:-
1 - Addition
2 - Multiplication
90. Write a program to display Transpose of a Matrix?
 Transpose of   1 6 8 2          is              1 2
                         2 5 1 9                           6 5
                                                               8 1
                                                               2 9
91. Write a program to print sum of diagonal elements of a 3 X 3 matrix?
Character and String (Day 20, 21) 
92. Write a program to calculate Length of the string?
93. Create a function to copy the string without using library function?
94. Create a function to concatenate two string without using library function?
95. Create a function to reverse the string passing a string pointer to a function without using library functions?
96. Accept a string and convert string into uppercase?
97. Accept String and 1- Count Vowel 2- Count Consonants 3- Count Number 4- Count Spaces 98. Input a string and check if it is palindrome or not?
Storage classes, structure, union, enum, typedef(22,23,24,25)  
98. What is Structure? Explain structure with example?
99. Create a Structure Emp to store Employee Record (empid, name, salary)?
100. Create a structure student with following members (rollno, name, course, percent). Store five students information and generate a report containing student data in below tabular format?
rollno  name  course   percentage   grade 
101. Create a structure to store six product details(pid, name, quantity, price). Print in Alphabetical order by product name?
102. Create a structure to store six Employee record (eid,name,salary) and print about those      employee Whose salary is greater than 20,000?
103. Create a structure Person with field Name, Age, Contact No., Address where Address is a structure type with fields (House number, city, state) in it? Store a person information input through user. 
 File Handling (Day 26,27) 
104. Write a program to find number of words in a File? 
105. Write a program to copy content from one file to another file? 
106. Create a file to store and display the student information(rollno, name, course, percent).  using fscanf() and fprintf()? 
107. Create a file to store and display the Employee information (eid, name salary) using fread() &fwrite()?  
108. Write a program to count occurrence of character 's' in file?




Mini project assignment 
Create a Result Processing Software: 
Create a structure student with following members rno, name, marks obtained from five subjects (physics , chemistry, maths, english, hindi), maximum marks of each subject. A data file will be prepared to maintain record of all the students.(At least 5 students) 
The menu driven program to print the mark sheet. 
The menu : 
1. Create a New file 
2. Add a record in a file 
3. Update  student record 
4. Delete student record 
5. Search student with name or by rollno  and display the details of a student  
6. Print the Marksheet of a particular student. (this will read a record of student, calculate percentage and grade on the marks a particular student) 
7. Exit  For each menu option write functions and each menu work with switch case in a

No comments:

Post a Comment

Friendship (Dosti)

      DOST Na jane jindagi mai kaha se aate hai dost, Apna bana kar dil chhu jate hai dost, Duniya mai sabse pyara rista hai dost, ...

Desire Error Solution