Welcome to the most comprehensive 152 C Programming Questions and Solutions master guide. Designed specifically for B.Tech, BCA, MCA, and engineering students preparing for university semester examinations (like MAKAUT), lab vivas, and technical coding interviews (TCS, Wipro, Cognizant, Infosys, LTIMindtree).

NOTE

All 152 programs in this guide are fully tested using GCC under C99/C11 standards. Each program includes full executable source code, explanations of key logic, and exam context.

---

Master Syllabus & Unit Quick Index

UnitTopic CoverageQuestion RangeKey Focus Areas
Unit 1Basics, Data Types, Operators, Control FlowQ1 – Q41GCC pipeline, Precedence, if-else, switch-case, leap year, roots, grading
Unit 2Loops, Series Summation, Pattern PrintingQ42 – Q83for/while/do-while, prime, Armstrong, Fibonacci, Krishnamurthy, 16+ Patterns
Unit 3Functions, Storage Classes, Pointers, ArraysQ84 – Q112Call by value/ref, static/extern, array ops, 2nd max/min, Adam number
Unit 4Strings, 2D Matrices, 6 Sorting AlgorithmsQ113 – Q143Matrix math, String without string.h, Bubble/Selection/Insertion/Quick/Merge/Shell Sort
Unit 5Recursion Mechanics & Call Stack TracesQ144 – Q150Stack frames, tail recursion, recursive factorial/fib/GCD/string rev
Unit 6Structures, Unions & Marksheet SystemQ151 – Q152Struct alignment, padding bytes, student database, MAKAUT grade generator

---

Quick Reference Cheatsheets

1. C Operator Precedence Table

PriorityCategoryOperatorsAssociativity
1 (Highest)Postfix() [] -> . ++ (post) -- (post)Left to Right
2Unary+ - ! ~ ++ (pre) -- (pre) (type) * & sizeofRight to Left
3Multiplicative* / %Left to Right
4Additive+ -Left to Right
5Relational< <= > >=Left to Right
6Equality== !=Left to Right
7Logical AND/OR&& ``Left to Right
8 (Lowest)Assignment= += -= *= /= %=Right to Left

2. Sorting Algorithms Performance Summary

AlgorithmBest TimeAverage TimeWorst TimeAuxiliary SpaceStability
Bubble SortO(N)O(N^2)O(N^2)O(1)Stable
Selection SortO(N^2)O(N^2)O(N^2)O(1)Unstable
Insertion SortO(N)O(N^2)O(N^2)O(1)Stable
Quick SortO(N \log N)O(N \log N)O(N^2)O(\log N)Unstable
Merge SortO(N \log N)O(N \log N)O(N \log N)O(N)Stable
Shell SortO(N \log N)O(N^{1.3})O(N^2)O(1)Unstable

---

Unit 1: Basics, Operators & Decision Control Flow (Q1 – Q41)

Question 1: Addition

Problem Statement: Write a C program to addition.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_001_addition.c -o prog (add -lm if using <math.h>).

---

Question 2: Subtraction

Problem Statement: Write a C program to subtraction.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_002_subtraction.c -o prog (add -lm if using <math.h>).

---

Question 3: Multiplication

Problem Statement: Write a C program to multiplication.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_003_multiplication.c -o prog (add -lm if using <math.h>).

---

Question 4: Division

Problem Statement: Write a C program to division.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_004_division.c -o prog (add -lm if using <math.h>).

---

Question 5: All mathematical operations consisting of 1 5

Problem Statement: Write a C program to all mathematical operations consisting of 1 5.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_005_all_mathematical_operations_consisting_of_1_5.c -o prog (add -lm if using <math.h>).

---

Question 6: Swap 2 numbers with variable

Problem Statement: Write a C program to swap 2 numbers with variable.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_006_swap_2_numbers_with_variable.c -o prog (add -lm if using <math.h>).

---

Question 7: Swap 2 numbers without variable

Problem Statement: Write a C program to swap 2 numbers without variable.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_007_swap_2_numbers_without_variable.c -o prog (add -lm if using <math.h>).

---

Question 8: Farenheit to celcius

Problem Statement: Write a C program to farenheit to celcius.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_008_farenheit_to_celcius.c -o prog (add -lm if using <math.h>).

---

Question 9: Reverse 5 digit number without loop

Problem Statement: Write a C program to reverse 5 digit number without loop.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_009_reverse_5_digit_number_without_loop.c -o prog (add -lm if using <math.h>).

---

Question 10: Max and min of 2 numbers

Problem Statement: Write a C program to max and min of 2 numbers.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_010_max_and_min_of_2_numbers.c -o prog (add -lm if using <math.h>).

---

Question 11: Max of 3 numbers

Problem Statement: Write a C program to max of 3 numbers.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_011_max_of_3_numbers.c -o prog (add -lm if using <math.h>).

---

Question 12: If number is ve ve or 0

Problem Statement: Write a C program to if number is ve ve or 0.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_012_if_number_is_ve_ve_or_0.c -o prog (add -lm if using <math.h>).

---

Question 13: If number is divisible by 5 and 11

Problem Statement: Write a C program to if number is divisible by 5 and 11.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_013_if_number_is_divisible_by_5_and_11.c -o prog (add -lm if using <math.h>).

---

Question 14: If number is even or odd

Problem Statement: Write a C program to if number is even or odd.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_014_if_number_is_even_or_odd.c -o prog (add -lm if using <math.h>).

---

Question 15: Check if leap year or not

Problem Statement: Write a C program to check if leap year or not.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_015_check_if_leap_year_or_not.c -o prog (add -lm if using <math.h>).

---

Question 16: Check if alphabet or not

Problem Statement: Write a C program to check if alphabet or not.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_016_check_if_alphabet_or_not.c -o prog (add -lm if using <math.h>).

---

Question 17: Check is vowel or consonant ifelse

Problem Statement: Write a C program to check is vowel or consonant ifelse.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_017_check_is_vowel_or_consonant_ifelse.c -o prog (add -lm if using <math.h>).

---

Question 18: Check is alphabet digit or special character

Problem Statement: Write a C program to check is alphabet digit or special character.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_018_check_is_alphabet_digit_or_special_character.c -o prog (add -lm if using <math.h>).

---

Question 19: Check if character is uppercase or lowercase

Problem Statement: Write a C program to check if character is uppercase or lowercase.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_019_check_if_character_is_uppercase_or_lowercase.c -o prog (add -lm if using <math.h>).

---

Question 20: Input week day number and print week day name ifelse

Problem Statement: Write a C program to input week day number and print week day name ifelse.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_020_input_week_day_number_and_print_week_day_name_ifelse.c -o prog (add -lm if using <math.h>).

---

Question 21: Total number of different notes in a given amount

Problem Statement: Write a C program to total number of different notes in a given amount.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_021_total_number_of_different_notes_in_a_given_amount.c -o prog (add -lm if using <math.h>).

---

Question 22: Check angles and verify if triangle is valid

Problem Statement: Write a C program to check angles and verify if triangle is valid.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_022_check_angles_and_verify_if_triangle_is_valid.c -o prog (add -lm if using <math.h>).

---

Question 23: Check if triangle is equilateral or isosceles

Problem Statement: Write a C program to check if triangle is equilateral or isosceles.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_023_check_if_triangle_is_equilateral_or_isosceles.c -o prog (add -lm if using <math.h>).

---

Question 24: Find roots of quadratic equation

Problem Statement: Write a C program to find roots of quadratic equation.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_024_find_roots_of_quadratic_equation.c -o prog (add -lm if using <math.h>).

---

Question 25: Find gross salary given basic salary

Problem Statement: Write a C program to find gross salary given basic salary.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_025_find_gross_salary_given_basic_salary.c -o prog (add -lm if using <math.h>).

---

Question 26: Input marks and print grade as per makaut regulations

Problem Statement: Write a C program to input marks and print grade as per makaut regulations.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_026_input_marks_and_print_grade_as_per_makaut_regulations.c -o prog (add -lm if using <math.h>).

---

Question 27: Take symbol from user and perform operation basic calculator ifelse

Problem Statement: Write a C program to take symbol from user and perform operation basic calculator ifelse.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_027_take_symbol_from_user_and_perform_operation_basic_calculator_ifelse.c -o prog (add -lm if using <math.h>).

---

Question 28: Take symbol from user and perform operation basic calculator switch

Problem Statement: Write a C program to take symbol from user and perform operation basic calculator switch.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_028_take_symbol_from_user_and_perform_operation_basic_calculator_switch.c -o prog (add -lm if using <math.h>).

---

Question 29: Check whether vowel or consonant switch

Problem Statement: Write a C program to check whether vowel or consonant switch.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_029_check_whether_vowel_or_consonant_switch.c -o prog (add -lm if using <math.h>).

---

Question 30: Input week day number and print week day name switch

Problem Statement: Write a C program to input week day number and print week day name switch.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_030_input_week_day_number_and_print_week_day_name_switch.c -o prog (add -lm if using <math.h>).

---

Question 31: Input m or f and print male of female ifelse

Problem Statement: Write a C program to input m or f and print male of female ifelse.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_031_input_m_or_f_and_print_male_of_female_ifelse.c -o prog (add -lm if using <math.h>).

---

Question 32: Input m or f and print male of female switch

Problem Statement: Write a C program to input m or f and print male of female switch.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_032_input_m_or_f_and_print_male_of_female_switch.c -o prog (add -lm if using <math.h>).

---

Question 33: Input month and print number of days ifelse

Problem Statement: Write a C program to input month and print number of days ifelse.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_033_input_month_and_print_number_of_days_ifelse.c -o prog (add -lm if using <math.h>).

---

Question 34: Input month and print number of days switch

Problem Statement: Write a C program to input month and print number of days switch.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_034_input_month_and_print_number_of_days_switch.c -o prog (add -lm if using <math.h>).

---

Question 35: Electricity bill ifelse

Problem Statement: Write a C program to electricity bill ifelse.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_035_electricity_bill_ifelse.c -o prog (add -lm if using <math.h>).

---

Question 36: Electricity bill switch

Problem Statement: Write a C program to electricity bill switch.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_036_electricity_bill_switch.c -o prog (add -lm if using <math.h>).

---

Question 37: Print all natural numbers in a range

Problem Statement: Write a C program to print all natural numbers in a range.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_037_print_all_natural_numbers_in_a_range.c -o prog (add -lm if using <math.h>).

---

Question 38: Print factorial of a given number while loop

Problem Statement: Write a C program to print factorial of a given number while loop.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_038_print_factorial_of_a_given_number_while_loop.c -o prog (add -lm if using <math.h>).

---

Question 39: Print sum of all numbers in a range

Problem Statement: Write a C program to print sum of all numbers in a range.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_039_print_sum_of_all_numbers_in_a_range.c -o prog (add -lm if using <math.h>).

---

Question 40: Find gross salary given basic salary switch

Problem Statement: Write a C program to find gross salary given basic salary switch.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_040_find_gross_salary_given_basic_salary_switch.c -o prog (add -lm if using <math.h>).

---

Question 41: Input marks and print grade as per makaut regulations switch

Problem Statement: Write a C program to input marks and print grade as per makaut regulations switch.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_041_input_marks_and_print_grade_as_per_makaut_regulations_switch.c -o prog (add -lm if using <math.h>).

---

Unit 2: Loops, Series Summation & Pattern Printing (Q42 – Q83)

Question 42: Write a program to print the numbers 1 to 10 using for loop

Problem Statement: Write a C program to write a program to print the numbers 1 to 10 using for loop.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_042_write_a_program_to_print_the_numbers_1_to_10_using_for_loop.c -o prog (add -lm if using <math.h>).

---

Question 43: Factorial of a number using for loop

Problem Statement: Write a C program to factorial of a number using for loop.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_043_factorial_of_a_number_using_for_loop.c -o prog (add -lm if using <math.h>).

---

Question 44: Sum of 10 numbers entered by user using for loop

Problem Statement: Write a C program to sum of 10 numbers entered by user using for loop.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_044_sum_of_10_numbers_entered_by_user_using_for_loop.c -o prog (add -lm if using <math.h>).

---

Question 45: Write a program to print the product of 10 numbers using for loop

Problem Statement: Write a C program to write a program to print the product of 10 numbers using for loop.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_045_write_a_program_to_print_the_product_of_10_numbers_using_for_loop.c -o prog (add -lm if using <math.h>).

---

Question 46: Write a program to print the sum of series 1 x x 2 x n

Problem Statement: Write a C program to write a program to print the sum of series 1 x x 2 x n.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_046_write_a_program_to_print_the_sum_of_series_1_x_x_2_x_n.c -o prog (add -lm if using <math.h>).

---

Question 47: Write a program to print the sum of series x x 2 x 3 x n

Problem Statement: Write a C program to write a program to print the sum of series x x 2 x 3 x n.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_047_write_a_program_to_print_the_sum_of_series_x_x_2_x_3_x_n.c -o prog (add -lm if using <math.h>).

---

Question 48: Write a program to print the sum of series 1 x 1 x 2 2 x 3 3 x n n

Problem Statement: Write a C program to write a program to print the sum of series 1 x 1 x 2 2 x 3 3 x n n.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_048_write_a_program_to_print_the_sum_of_series_1_x_1_x_2_2_x_3_3_x_n_n.c -o prog (add -lm if using <math.h>).

---

Question 49: Write a program to print the sum of series 1 x 1 x 2 2 x 3 3 x n n

Problem Statement: Write a C program to write a program to print the sum of series 1 x 1 x 2 2 x 3 3 x n n.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_049_write_a_program_to_print_the_sum_of_series_1_x_1_x_2_2_x_3_3_x_n_n.c -o prog (add -lm if using <math.h>).

---

Question 50: Calculate result of series 1 1 2 1 2 3 1 2 n

Problem Statement: Write a C program to calculate result of series 1 1 2 1 2 3 1 2 n.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_050_calculate_result_of_series_1_1_2_1_2_3_1_2_n.c -o prog (add -lm if using <math.h>).

---

Question 51: Write a program to print the sum of series 1 11 111 1111

Problem Statement: Write a C program to write a program to print the sum of series 1 11 111 1111.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_051_write_a_program_to_print_the_sum_of_series_1_11_111_1111.c -o prog (add -lm if using <math.h>).

---

Question 52: Write a program to check whether a number is prime number or not

Problem Statement: Write a C program to write a program to check whether a number is prime number or not.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_052_write_a_program_to_check_whether_a_number_is_prime_number_or_not.c -o prog (add -lm if using <math.h>).

---

Question 53: Write a program to print the total numbers of odd and even numbers in range and add them separately

Problem Statement: Write a C program to write a program to print the total numbers of odd and even numbers in range and add them separately.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_053_write_a_program_to_print_the_total_numbers_of_odd_and_even_numbers_in_range_and_add_them_separately.c -o prog (add -lm if using <math.h>).

---

Question 54: Write a program to calculate if a number is armstrong or not within a range

Problem Statement: Write a C program to write a program to calculate if a number is armstrong or not within a range.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_054_write_a_program_to_calculate_if_a_number_is_armstrong_or_not_within_a_range.c -o prog (add -lm if using <math.h>).

---

Question 55: Write a program to find out the fibonacci series within a range

Problem Statement: Write a C program to write a program to find out the fibonacci series within a range.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_055_write_a_program_to_find_out_the_fibonacci_series_within_a_range.c -o prog (add -lm if using <math.h>).

---

Question 56: Write a program to find out the non fibonacci nos within a range

Problem Statement: Write a C program to write a program to find out the non fibonacci nos within a range.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_056_write_a_program_to_find_out_the_non_fibonacci_nos_within_a_range.c -o prog (add -lm if using <math.h>).

---

Question 57: Write a program to find out if a number is palindrome or not

Problem Statement: Write a C program to write a program to find out if a number is palindrome or not.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_057_write_a_program_to_find_out_if_a_number_is_palindrome_or_not.c -o prog (add -lm if using <math.h>).

---

Question 58: Write a program to reverse a number for loop

Problem Statement: Write a C program to write a program to reverse a number for loop.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_058_write_a_program_to_reverse_a_number_for_loop.c -o prog (add -lm if using <math.h>).

---

Question 59: Write a program to find out if a number is krishnamurty number or not

Problem Statement: Write a C program to write a program to find out if a number is krishnamurty number or not.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_059_write_a_program_to_find_out_if_a_number_is_krishnamurty_number_or_not.c -o prog (add -lm if using <math.h>).

---

Question 60: Write a program to find out the binary to decimal and vice versa

Problem Statement: Write a C program to write a program to find out the binary to decimal and vice versa.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_060_write_a_program_to_find_out_the_binary_to_decimal_and_vice_versa.c -o prog (add -lm if using <math.h>).

---

Question 61: Write a program to calculate the gcd of two numbers

Problem Statement: Write a C program to write a program to calculate the gcd of two numbers.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_061_write_a_program_to_calculate_the_gcd_of_two_numbers.c -o prog (add -lm if using <math.h>).

---

Question 62: Write a program to print the sum of series 1 1 2 1 3 1 n

Problem Statement: Write a C program to write a program to print the sum of series 1 1 2 1 3 1 n.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_062_write_a_program_to_print_the_sum_of_series_1_1_2_1_3_1_n.c -o prog (add -lm if using <math.h>).

---

Question 63: Write a program to print the sum of series 1 2 2 3 3 n n

Problem Statement: Write a C program to write a program to print the sum of series 1 2 2 3 3 n n.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_063_write_a_program_to_print_the_sum_of_series_1_2_2_3_3_n_n.c -o prog (add -lm if using <math.h>).

---

Question 64: Write a program to print the sum of series 1 2 2 3 3 4 n 1 n

Problem Statement: Write a C program to write a program to print the sum of series 1 2 2 3 3 4 n 1 n.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_064_write_a_program_to_print_the_sum_of_series_1_2_2_3_3_4_n_1_n.c -o prog (add -lm if using <math.h>).

---

Question 65: Write a program to print the sum of series 1 2 2 2 3 3 3 n n n

Problem Statement: Write a C program to write a program to print the sum of series 1 2 2 2 3 3 3 n n n.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_065_write_a_program_to_print_the_sum_of_series_1_2_2_2_3_3_3_n_n_n.c -o prog (add -lm if using <math.h>).

---

Question 66: Write a program to print the sum of series x x 3 3 x 5 5 x 7 7

Problem Statement: Write a C program to write a program to print the sum of series x x 3 3 x 5 5 x 7 7.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_066_write_a_program_to_print_the_sum_of_series_x_x_3_3_x_5_5_x_7_7.c -o prog (add -lm if using <math.h>).

---

Question 67: Write a program to repeatedly divide a number by 2 and print the quotient

Problem Statement: Write a C program to write a program to repeatedly divide a number by 2 and print the quotient.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_067_write_a_program_to_repeatedly_divide_a_number_by_2_and_print_the_quotient.c -o prog (add -lm if using <math.h>).

---

Question 68: Pattern where the row is given by the user

Problem Statement: Write a C program to pattern where the row is given by the user.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_068_pattern_where_the_row_is_given_by_the_user.c -o prog (add -lm if using <math.h>).

---

Question 69: Pattern where the row is given by the user

Problem Statement: Write a C program to pattern where the row is given by the user.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_069_pattern_where_the_row_is_given_by_the_user.c -o prog (add -lm if using <math.h>).

---

Question 70: Pattern where the row is given by the user

Problem Statement: Write a C program to pattern where the row is given by the user.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_070_pattern_where_the_row_is_given_by_the_user.c -o prog (add -lm if using <math.h>).

---

Question 71: Pattern where the row is given by the user

Problem Statement: Write a C program to pattern where the row is given by the user.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_071_pattern_where_the_row_is_given_by_the_user.c -o prog (add -lm if using <math.h>).

---

Question 72: Pattern where the row is given by the user

Problem Statement: Write a C program to pattern where the row is given by the user.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_072_pattern_where_the_row_is_given_by_the_user.c -o prog (add -lm if using <math.h>).

---

Question 73: Pattern where the row is given by the user

Problem Statement: Write a C program to pattern where the row is given by the user.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_073_pattern_where_the_row_is_given_by_the_user.c -o prog (add -lm if using <math.h>).

---

Question 74: Pattern where the row is given by the user

Problem Statement: Write a C program to pattern where the row is given by the user.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_074_pattern_where_the_row_is_given_by_the_user.c -o prog (add -lm if using <math.h>).

---

Question 75: Pattern where the row is given by the user

Problem Statement: Write a C program to pattern where the row is given by the user.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_075_pattern_where_the_row_is_given_by_the_user.c -o prog (add -lm if using <math.h>).

---

Question 76: Pattern where the row is given by the user

Problem Statement: Write a C program to pattern where the row is given by the user.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_076_pattern_where_the_row_is_given_by_the_user.c -o prog (add -lm if using <math.h>).

---

Question 77: Pattern where the row is given by the user

Problem Statement: Write a C program to pattern where the row is given by the user.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_077_pattern_where_the_row_is_given_by_the_user.c -o prog (add -lm if using <math.h>).

---

Question 78: Pattern where the row is given by the user

Problem Statement: Write a C program to pattern where the row is given by the user.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_078_pattern_where_the_row_is_given_by_the_user.c -o prog (add -lm if using <math.h>).

---

Question 79: Pattern where the row is given by the user

Problem Statement: Write a C program to pattern where the row is given by the user.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_079_pattern_where_the_row_is_given_by_the_user.c -o prog (add -lm if using <math.h>).

---

Question 80: Pattern where the row is given by the user

Problem Statement: Write a C program to pattern where the row is given by the user.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_080_pattern_where_the_row_is_given_by_the_user.c -o prog (add -lm if using <math.h>).

---

Question 81: Pattern where the row is given by the user

Problem Statement: Write a C program to pattern where the row is given by the user.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_081_pattern_where_the_row_is_given_by_the_user.c -o prog (add -lm if using <math.h>).

---

Question 82: Pattern where the row is given by the user

Problem Statement: Write a C program to pattern where the row is given by the user.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_082_pattern_where_the_row_is_given_by_the_user.c -o prog (add -lm if using <math.h>).

---

Question 83: Pattern where the row is given by the user

Problem Statement: Write a C program to pattern where the row is given by the user.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_083_pattern_where_the_row_is_given_by_the_user.c -o prog (add -lm if using <math.h>).

---

Unit 3: Functions, Storage Classes, Pointers & 1D Arrays (Q84 – Q112)

Question 84: Gcd of two numbers

Problem Statement: Write a C program to gcd of two numbers.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_084_gcd_of_two_numbers.c -o prog (add -lm if using <math.h>).

---

Question 85: Max and min of 2 numbers

Problem Statement: Write a C program to max and min of 2 numbers.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_085_max_and_min_of_2_numbers.c -o prog (add -lm if using <math.h>).

---

Question 86: Fibonacci series

Problem Statement: Write a C program to fibonacci series.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_086_fibonacci_series.c -o prog (add -lm if using <math.h>).

---

Question 87: Perform the following activities in a given range count sum of odd even numbers

Problem Statement: Write a C program to perform the following activities in a given range count sum of odd even numbers.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_087_perform_the_following_activities_in_a_given_range_count_sum_of_odd_even_numbers.c -o prog (add -lm if using <math.h>).

---

Question 88: Factorial of a number

Problem Statement: Write a C program to factorial of a number.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_088_factorial_of_a_number.c -o prog (add -lm if using <math.h>).

---

Question 89: Prove whether a number is adam number or not

Problem Statement: Write a C program to prove whether a number is adam number or not.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_089_prove_whether_a_number_is_adam_number_or_not.c -o prog (add -lm if using <math.h>).

---

Question 90: Print pascal s triangle use function where n is entered by user

Problem Statement: Write a C program to print pascal s triangle use function where n is entered by user.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_090_print_pascal_s_triangle_use_function_where_n_is_entered_by_user.c -o prog (add -lm if using <math.h>).

---

Question 91: Increment values and print result in main and in function

Problem Statement: Write a C program to increment values and print result in main and in function.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_091_increment_values_and_print_result_in_main_and_in_function.c -o prog (add -lm if using <math.h>).

---

Question 92: Interchange two variables using call by value and call by reference

Problem Statement: Write a C program to interchange two variables using call by value and call by reference.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_092_interchange_two_variables_using_call_by_value_and_call_by_reference.c -o prog (add -lm if using <math.h>).

---

Question 93: Take a 5 digit number reverse it and check whether palindrome or not

Problem Statement: Write a C program to take a 5 digit number reverse it and check whether palindrome or not.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_093_take_a_5_digit_number_reverse_it_and_check_whether_palindrome_or_not.c -o prog (add -lm if using <math.h>).

---

Question 94: Update the value of a variable using call by value and call by reference

Problem Statement: Write a C program to update the value of a variable using call by value and call by reference.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_094_update_the_value_of_a_variable_using_call_by_value_and_call_by_reference.c -o prog (add -lm if using <math.h>).

---

Question 95: Sum the elements of an array and print the sum in the main program

Problem Statement: Write a C program to sum the elements of an array and print the sum in the main program.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_095_sum_the_elements_of_an_array_and_print_the_sum_in_the_main_program.c -o prog (add -lm if using <math.h>).

---

Question 96: Increment 10 elements in an array by 1 in separate function

Problem Statement: Write a C program to increment 10 elements in an array by 1 in separate function.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_096_increment_10_elements_in_an_array_by_1_in_separate_function.c -o prog (add -lm if using <math.h>).

---

Question 97: To find the max and min of 10 elements in an array

Problem Statement: Write a C program to to find the max and min of 10 elements in an array.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_097_to_find_the_max_and_min_of_10_elements_in_an_array.c -o prog (add -lm if using <math.h>).

---

Question 98: Count odd and even numbers and sum them separately

Problem Statement: Write a C program to count odd and even numbers and sum them separately.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_098_count_odd_and_even_numbers_and_sum_them_separately.c -o prog (add -lm if using <math.h>).

---

Question 99: Reverse the elements in an array and print them

Problem Statement: Write a C program to reverse the elements in an array and print them.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_099_reverse_the_elements_in_an_array_and_print_them.c -o prog (add -lm if using <math.h>).

---

Question 100: Copy the elements of an array from one array to another

Problem Statement: Write a C program to copy the elements of an array from one array to another.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_100_copy_the_elements_of_an_array_from_one_array_to_another.c -o prog (add -lm if using <math.h>).

---

Question 101: Sort an array in ascending and descending order

Problem Statement: Write a C program to sort an array in ascending and descending order.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_101_sort_an_array_in_ascending_and_descending_order.c -o prog (add -lm if using <math.h>).

---

Question 102: Merge two sorted arrays

Problem Statement: Write a C program to merge two sorted arrays.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_102_merge_two_sorted_arrays.c -o prog (add -lm if using <math.h>).

---

Question 103: Print the unique elements in an array

Problem Statement: Write a C program to print the unique elements in an array.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_103_print_the_unique_elements_in_an_array.c -o prog (add -lm if using <math.h>).

---

Question 104: Find out the 2nd largest element in the array

Problem Statement: Write a C program to find out the 2nd largest element in the array.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_104_find_out_the_2nd_largest_element_in_the_array.c -o prog (add -lm if using <math.h>).

---

Question 105: Find out the 2nd smallest element in the array

Problem Statement: Write a C program to find out the 2nd smallest element in the array.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_105_find_out_the_2nd_smallest_element_in_the_array.c -o prog (add -lm if using <math.h>).

---

Question 106: Add two arrays and print the 3rd array

Problem Statement: Write a C program to add two arrays and print the 3rd array.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_106_add_two_arrays_and_print_the_3rd_array.c -o prog (add -lm if using <math.h>).

---

Question 107: Print values and address of two variables

Problem Statement: Write a C program to print values and address of two variables.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_107_print_values_and_address_of_two_variables.c -o prog (add -lm if using <math.h>).

---

Question 108: Swapping without a 3rd variable

Problem Statement: Write a C program to swapping without a 3rd variable.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_108_swapping_without_a_3rd_variable.c -o prog (add -lm if using <math.h>).

---

Question 109: Fahrenheit to celcius

Problem Statement: Write a C program to fahrenheit to celcius.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_109_fahrenheit_to_celcius.c -o prog (add -lm if using <math.h>).

---

Question 110: Factorial of a number

Problem Statement: Write a C program to factorial of a number.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_110_factorial_of_a_number.c -o prog (add -lm if using <math.h>).

---

Question 111: Count the numbers of duplicate numbers in an array

Problem Statement: Write a C program to count the numbers of duplicate numbers in an array.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_111_count_the_numbers_of_duplicate_numbers_in_an_array.c -o prog (add -lm if using <math.h>).

---

Question 112: Take two arrays merge them sort the resultant array and eliminate duplicate elements in another array

Problem Statement: Write a C program to take two arrays merge them sort the resultant array and eliminate duplicate elements in another array.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_112_take_two_arrays_merge_them_sort_the_resultant_array_and_eliminate_duplicate_elements_in_another_array.c -o prog (add -lm if using <math.h>).

---

Unit 4: Strings, 2D Matrices & 6 Sorting Algorithms (Q113 – Q143)

Question 113: Input two matrixes and add them

Problem Statement: Write a C program to input two matrixes and add them.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_113_input_two_matrixes_and_add_them.c -o prog (add -lm if using <math.h>).

---

Question 114: Input two matrixes and subtract them

Problem Statement: Write a C program to input two matrixes and subtract them.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_114_input_two_matrixes_and_subtract_them.c -o prog (add -lm if using <math.h>).

---

Question 115: Input two matrixes and multiply them

Problem Statement: Write a C program to input two matrixes and multiply them.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_115_input_two_matrixes_and_multiply_them.c -o prog (add -lm if using <math.h>).

---

Question 116: Input two matrixes and transpose them

Problem Statement: Write a C program to input two matrixes and transpose them.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_116_input_two_matrixes_and_transpose_them.c -o prog (add -lm if using <math.h>).

---

Question 117: Input two matrixes and add the column and rows values separately

Problem Statement: Write a C program to input two matrixes and add the column and rows values separately.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_117_input_two_matrixes_and_add_the_column_and_rows_values_separately.c -o prog (add -lm if using <math.h>).

---

Question 118: Input two matrixes and find the sum of the diagonal elements

Problem Statement: Write a C program to input two matrixes and find the sum of the diagonal elements.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_118_input_two_matrixes_and_find_the_sum_of_the_diagonal_elements.c -o prog (add -lm if using <math.h>).

---

Question 119: Find out the length of a string pointer

Problem Statement: Write a C program to find out the length of a string pointer.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_119_find_out_the_length_of_a_string_pointer.c -o prog (add -lm if using <math.h>).

---

Question 120: Find out the length of a string without pointer

Problem Statement: Write a C program to find out the length of a string without pointer.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_120_find_out_the_length_of_a_string_without_pointer.c -o prog (add -lm if using <math.h>).

---

Question 121: Copy an array of string

Problem Statement: Write a C program to copy an array of string.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_121_copy_an_array_of_string.c -o prog (add -lm if using <math.h>).

---

Question 122: Copy the string in reverse order pointer

Problem Statement: Write a C program to copy the string in reverse order pointer.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_122_copy_the_string_in_reverse_order_pointer.c -o prog (add -lm if using <math.h>).

---

Question 123: To check palindrome or not

Problem Statement: Write a C program to to check palindrome or not.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_123_to_check_palindrome_or_not.c -o prog (add -lm if using <math.h>).

---

Question 124: Input of a string using s c gets ch and print them separately

Problem Statement: Write a C program to input of a string using s c gets ch and print them separately.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_124_input_of_a_string_using_s_c_gets_ch_and_print_them_separately.c -o prog (add -lm if using <math.h>).

---

Question 125: No of words and characters in a string

Problem Statement: Write a C program to no of words and characters in a string.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_125_no_of_words_and_characters_in_a_string.c -o prog (add -lm if using <math.h>).

---

Question 126: No of vowels consonants digits and whitespace

Problem Statement: Write a C program to no of vowels consonants digits and whitespace.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_126_no_of_vowels_consonants_digits_and_whitespace.c -o prog (add -lm if using <math.h>).

---

Question 127: Ascii value of a character

Problem Statement: Write a C program to ascii value of a character.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_127_ascii_value_of_a_character.c -o prog (add -lm if using <math.h>).

---

Question 128: Concatenate two strings without strcat

Problem Statement: Write a C program to concatenate two strings without strcat.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_128_concatenate_two_strings_without_strcat.c -o prog (add -lm if using <math.h>).

---

Question 129: Reverse without strrev

Problem Statement: Write a C program to reverse without strrev.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_129_reverse_without_strrev.c -o prog (add -lm if using <math.h>).

---

Question 130: To copy a string

Problem Statement: Write a C program to to copy a string.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_130_to_copy_a_string.c -o prog (add -lm if using <math.h>).

---

Question 131: Remove characters in a string without alphabets

Problem Statement: Write a C program to remove characters in a string without alphabets.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_131_remove_characters_in_a_string_without_alphabets.c -o prog (add -lm if using <math.h>).

---

Question 132: Sort string in dictionary order

Problem Statement: Write a C program to sort string in dictionary order.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_132_sort_string_in_dictionary_order.c -o prog (add -lm if using <math.h>).

---

Question 133: Compare two string strcmp

Problem Statement: Write a C program to compare two string strcmp.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_133_compare_two_string_strcmp.c -o prog (add -lm if using <math.h>).

---

Question 134: Compare two string without strcmp

Problem Statement: Write a C program to compare two string without strcmp.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_134_compare_two_string_without_strcmp.c -o prog (add -lm if using <math.h>).

---

Question 135: Substring inside a given string

Problem Statement: Write a C program to substring inside a given string.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_135_substring_inside_a_given_string.c -o prog (add -lm if using <math.h>).

---

Question 136: Convert string to opposite case

Problem Statement: Write a C program to convert string to opposite case.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_136_convert_string_to_opposite_case.c -o prog (add -lm if using <math.h>).

---

Question 137: Passing string to function

Problem Statement: Write a C program to passing string to function.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_137_passing_string_to_function.c -o prog (add -lm if using <math.h>).

---

Question 138: Bubble sort

Problem Statement: Write a C program to bubble sort.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_138_bubble_sort.c -o prog (add -lm if using <math.h>).

---

Question 139: Insertion sort

Problem Statement: Write a C program to insertion sort.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_139_insertion_sort.c -o prog (add -lm if using <math.h>).

---

Question 140: Selection sort

Problem Statement: Write a C program to selection sort.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_140_selection_sort.c -o prog (add -lm if using <math.h>).

---

Question 141: Quick sort

Problem Statement: Write a C program to quick sort.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_141_quick_sort.c -o prog (add -lm if using <math.h>).

---

Question 142: Merge sort

Problem Statement: Write a C program to merge sort.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_142_merge_sort.c -o prog (add -lm if using <math.h>).

---

Question 143: Shell sort

Problem Statement: Write a C program to shell sort.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_143_shell_sort.c -o prog (add -lm if using <math.h>).

---

Unit 5: Recursion Mechanics & Call Stack Traces (Q144 – Q150)

Question 144: Factorial of a number

Problem Statement: Write a C program to factorial of a number.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_144_factorial_of_a_number.c -o prog (add -lm if using <math.h>).

---

Question 145: Decrease number indirect recursion

Problem Statement: Write a C program to decrease number indirect recursion.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_145_decrease_number_indirect_recursion.c -o prog (add -lm if using <math.h>).

---

Question 146: Sum of n natural numbers

Problem Statement: Write a C program to sum of n natural numbers.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_146_sum_of_n_natural_numbers.c -o prog (add -lm if using <math.h>).

---

Question 147: Reverse of a number

Problem Statement: Write a C program to reverse of a number.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_147_reverse_of_a_number.c -o prog (add -lm if using <math.h>).

---

Question 148: Gcd of two numbers

Problem Statement: Write a C program to gcd of two numbers.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_148_gcd_of_two_numbers.c -o prog (add -lm if using <math.h>).

---

Question 149: Reverse of a string using strrev

Problem Statement: Write a C program to reverse of a string using strrev.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_149_reverse_of_a_string_using_strrev.c -o prog (add -lm if using <math.h>).

---

Question 150: Fibonacci series

Problem Statement: Write a C program to fibonacci series.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_150_fibonacci_series.c -o prog (add -lm if using <math.h>).

---

Unit 6: Structures, Memory Alignment & Marksheet System (Q151 – Q152)

Question 151: Student database roll name address

Problem Statement: Write a C program to student database roll name address.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_151_student_database_roll_name_address.c -o prog (add -lm if using <math.h>).

---

Question 152: Scan roll no and marks of each sub per student print avg of marks and the grade of each student print the grade in totality and also according to each subject

Problem Statement: Write a C program to scan roll no and marks of each sub per student print avg of marks and the grade of each student print the grade in totality and also according to each subject.

c
NOTE

Key Takeaway: Always handle edge cases like invalid input or zero values. Compile with gcc prog_152_scan_roll_no_and_marks_of_each_sub_per_student_print_avg_of_marks_and_the_grade_of_each_student_print_the_grade_in_totality_and_also_according_to_each_subject.c -o prog (add -lm if using <math.h>).

---

Frequently Asked Questions (FAQs)

Q1. How should I prepare C programming for university semester exams?

Start with Unit 1 basic syntax and operator precedence rules, practice all loop series and pattern programs in Unit 2, master call-by-reference and pointer arithmetic in Unit 3, implement all 6 sorting algorithms in Unit 4, trace stack activation frames in Unit 5, and write struct-based database programs in Unit 6.

Q2. Which sorting algorithms are most frequently asked in exams?

Quick Sort and Merge Sort (Divide & Conquer) carry 10–15 marks in long questions, while Bubble Sort and Insertion Sort are common 5-mark items.

Q3. Why is % (modulus) operator restricted to integer operands?

The % operator computes the integer remainder. Floating point division yields continuous quotient fractions without integer remainders. For float remainders, use fmod() from <math.h>.

Q4. What is the difference between call by value and call by reference in C?

Call by value passes a copy of the argument variable to the function, so modifications do not affect the caller. Call by reference passes memory addresses (pointers), allowing the function to directly modify the caller variables in memory.

Q5. How does structure padding affect memory size in C?

Compilers insert unused padding bytes between struct fields to align members with CPU word boundaries (4-byte or 8-byte boundaries). Use #pragma pack(1) to force packed memory allocation without padding.