C Programming Practical Important Program Questions | C Programming Coding Questions and Answers

1. Write a C program to calculate simple interest.



Output: 





2.Write a program to input marks of 5 subjects of a student and calculate total, average marks and percentage of all subjects. Assume that the maximum marks obtained by a student in each subject is 100.




Output



3.The basic salary of an employee is input through the keyboard. The DA is 15% of the basic salary while the HRA is 25% of the basic salary. Write a program to calculate his total salary.




Output:





      4. Write a program in C to swap two numbers using third variable.




Output:





5. Write a program to swap two numbers without using third variable.





Output:



      6.Write a C program to check whether a number is even or odd.

    



Output:
    
E
    
    
     7. Write a C program to check whether a year is leap year or not.

    



    Output:
    



      8. Write a program in C to find the greatest number among three numbers.
    


Output:
    


S  

      9. Write a program to input marks of three subjects of a student. Calculate total and average marks and display grade. The students get grade as per the following conditions:


           Average                   Grade
        90-100                        A
        80-89                          B
        70-79                          C
         60-69                         D
         0-59                           F

     (Assume that maximum marks obtained by a student in each subject is 100) 


Output:


        

     10. Write a C program to find biggest of three numbers using nested if.

    


Output:






11. Write a C program to check whether a character is vowel or not using switch case.




Output:

   


OR

    

    

    

    12. Write a C program to print 1st 100 natural numbers.




    
Output:


     

 

       13. Write a C program to find the factorial of a number using for loop.





Output:



    

    14Write a C program to print all alphabets (a to z) using while loop.



    Output:


    

    

    15Write a C program to print the multiplication table from 1 to 5.





Output:




   

     16. Write a C program to find the sum of first n natural numbers.


 Output:



     

      17. Write a C program to find the sum of the following series:
    
    S=1+1/2+1/3+1/4…+1/n



Output:

   

   18.Write a C program to display Fibonacci series.
                          Or
Write a program in C to generate the first n Fibonacci series.
                          Or
Write a program to find first N Fibonacci numbers.
                          Or
Write a C program to print the following series:

  0 1 1 2 3 5 8



    
Output:



 

     19. Write a C program to calculate the sum of a 3 digit number.

                               OR

      Write a C program to find the sum of a given integer.




   Output:



     

      20. Write a C program to print the reverse of a given number.

                          Or

     Write a program to reverse digits of an integer.    

                          Or

     Write C program for reversing a given integer.



    
    Output:




    

   21. Write a C program to read and print elements of array.



    Output:



    

    

    22. Write a program in C to display the largest and smallest element in an integer array.




    Output:

      

    

     23. Write a C program to insert an element at specific index position.


     

    


    Output:
    



     24. Write a program to find the length of string using strlen(). 





Output:

   


   

     25. Write a program to copy one string to another string using strcpy().





 Output:
    
    

   

     26. Write a program to concatenate (join) two strings.




  
Output:


   


    27. Write a program to compare two strings.





 Output:

    

      
    28. Write a program to check whether a string is palindrome or not.
                Or
     Write a program to find whether the given string is palindrome or not.      




   
Output:

   

   

     29. Write a program in C to find the factorial of a number using function.




 
Output:




     

   30. Write a C program using function to print the Fibonacci series upto N.





Output:



   

    

   31. Write a C program to add two numbers using pointers.




 
Output:
    


   

        32. Write a program to swap two numbers using function (call by reference).



    

  Output:




     33. Write a program in C to enter emp_id, emp_name and salary of three employees and display the records using structure.



    

Output:

    

   

   34. Write a program in C to read name and marks of n number of students and store them in a file.



 

Output:

    

    

    

   35. Write a C program to read a text file and print the output.

   

Output:









Post a Comment

0 Comments