{"id":20346994,"url":"https://github.com/pankaj-str/c-interview-questions","last_synced_at":"2025-06-13T23:35:10.195Z","repository":{"id":166359208,"uuid":"641843954","full_name":"Pankaj-Str/C-Interview-Questions","owner":"Pankaj-Str","description":"C Programs: Practicing and solving problems is the best way to learn anything","archived":false,"fork":false,"pushed_at":"2023-10-12T15:40:46.000Z","size":87,"stargazers_count":28,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T00:53:11.965Z","etag":null,"topics":["c","cprogramming","cprogramming-language","cquestions","interview-questions"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pankaj-Str.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-05-17T09:28:22.000Z","updated_at":"2024-10-09T08:35:13.000Z","dependencies_parsed_at":"2023-05-31T06:15:29.937Z","dependency_job_id":null,"html_url":"https://github.com/Pankaj-Str/C-Interview-Questions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pankaj-Str%2FC-Interview-Questions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pankaj-Str%2FC-Interview-Questions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pankaj-Str%2FC-Interview-Questions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pankaj-Str%2FC-Interview-Questions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pankaj-Str","download_url":"https://codeload.github.com/Pankaj-Str/C-Interview-Questions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248501882,"owners_count":21114682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","cprogramming","cprogramming-language","cquestions","interview-questions"],"created_at":"2024-11-14T22:14:58.578Z","updated_at":"2025-04-12T00:53:17.239Z","avatar_url":"https://github.com/Pankaj-Str.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 100 Interview Questions - \n\n1. **Question 1:**\n   **Question:** Write a C program that prints numbers from 1 to 10 using a `for` loop.\n   **Expected Output:**\n   ```\n   1 2 3 4 5 6 7 8 9 10\n   ```\n\n2. **Question 2:**\n   **Question:** Create a C program that prints the even numbers from 2 to 20 using a `while` loop.\n   **Expected Output:**\n   ```\n   2 4 6 8 10 12 14 16 18 20\n   ```\n\n3. **Question 3:**\n   **Question:** Develop a program that calculates the sum of numbers from 1 to 100 using a `for` loop.\n   **Expected Output:**\n   ```\n   The sum of numbers from 1 to 100 is 5050.\n   ```\n\n4. **Question 4:**\n   **Question:** Write a C program that prints the first 10 terms of the Fibonacci sequence using a `do-while` loop.\n   **Expected Output:**\n   ```\n   Fibonacci series: 0 1 1 2 3 5 8 13 21 34\n   ```\n\n5. **Question 5:**\n   **Question:** Create a program that prompts the user to enter a positive integer and then prints the multiplication table for that number from 1 to 10 using a `for` loop.\n   **Expected Output:**\n   ```\n   Enter a number: 7\n   Multiplication table for 7:\n   7 x 1 = 7\n   7 x 2 = 14\n   ...\n   7 x 10 = 70\n   ```\n\n6. **Question 6:**\n   **Question:** Develop a C program that prints a pattern of asterisks in the shape of a right-angled triangle using nested `for` loops.\n   **Expected Output:**\n   ```\n   *\n   **\n   ***\n   ****\n   *****\n   ```\n\n7. **Question 7:**\n   **Question:** Write a program that calculates the factorial of a user-entered number using a `while` loop.\n   **Expected Output:**\n   ```\n   Enter a number: 5\n   The factorial of 5 is 120.\n   ```\n\n8. **Question 8:**\n   **Question:** Create a C program that checks if a user-entered number is a prime number using a `for` loop.\n   **Expected Output:**\n   ```\n   Enter a number: 17\n   17 is a prime number.\n   ```\n\n9. **Question 9:**\n   **Question:** Develop a program that finds and displays the prime numbers in a given range (e.g., 1 to 100) using a `for` loop.\n   **Expected Output:**\n   ```\n   Prime numbers in the range 1 to 100 are: 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97\n   ```\n\n10. **Question 10:**\n    **Question:** Write a C program that prints the ASCII values and characters for all printable characters (from ' ' to '~') using a `for` loop.\n    **Expected Output:**\n    ```\n    ASCII values and characters for printable characters:\n    ' ' (Space) - ASCII: 32\n    '!' - ASCII: 33\n    '\"' - ASCII: 34\n    ...\n    '~' - ASCII: 126\n    ```\n\n\n11. **Question 11:**\n    **Question:** Create a C program that calculates the sum of all even numbers between 1 and 50 using a `for` loop.\n    **Expected Output:**\n    ```\n    The sum of even numbers from 1 to 50 is 650.\n    ```\n\n12. **Question 12:**\n    **Question:** Write a C program that checks if a user-entered number is a perfect number. A perfect number is a positive integer that is equal to the sum of its proper divisors (excluding itself).\n    **Expected Output:**\n    ```\n    Enter a number: 28\n    28 is a perfect number.\n    ```\n\n13. **Question 13:**\n    **Question:** Develop a program that calculates the factorial of a user-entered number using a `do-while` loop.\n    **Expected Output:**\n    ```\n    Enter a number: 6\n    The factorial of 6 is 720.\n    ```\n\n14. **Question 14:**\n    **Question:** Create a C program that prints the squares of numbers from 1 to 10 using a `for` loop.\n    **Expected Output:**\n    ```\n    1^2 = 1\n    2^2 = 4\n    3^2 = 9\n    ...\n    10^2 = 100\n    ```\n\n15. **Question 15:**\n    **Question:** Write a C program that calculates the sum of a geometric series (1 + 2 + 4 + 8 + ... + 2^n) using a `for` loop. Prompt the user for the number of terms (n).\n    **Expected Output:**\n    ```\n    Enter the number of terms (n): 5\n    The sum of the geometric series is 31.\n    ```\n\n16. **Question 16:**\n    **Question:** Develop a C program that prints the first n terms of the square root series (1, sqrt(2), sqrt(3), ...) using a `for` loop.\n    **Expected Output:**\n    ```\n    Enter the number of terms (n): 4\n    Square root series: 1.000 1.414 1.732 2.000\n    ```\n\n17. **Question 17:**\n    **Question:** Create a program that calculates the sum of an arithmetic series (3 + 7 + 11 + ... + 3n - 1) using a `for` loop. Prompt the user for the number of terms (n).\n    **Expected Output:**\n    ```\n    Enter the number of terms (n): 5\n    The sum of the arithmetic series is 75.\n    ```\n\n18. **Question 18:**\n    **Question:** Write a C program that prints the numbers from 100 to 1 in reverse order using a `while` loop.\n    **Expected Output:**\n    ```\n    100 99 98 97 96 ... 4 3 2 1\n    ```\n\n19. **Question 19:**\n    **Question:** Develop a program that generates and displays the Collatz sequence starting from a user-entered number. The Collatz sequence for a positive integer n is defined as follows: if n is even, divide it by 2; if n is odd, multiply it by 3 and add 1.\n    **Expected Output:**\n    ```\n    Enter a number: 10\n    Collatz sequence: 10 5 16 8 4 2 1\n    ```\n\n20. **Question 20:**\n    **Question:** Create a C program that calculates and displays the GCD (greatest common divisor) of two user-entered numbers using the Euclidean algorithm in a `while` loop.\n    **Expected Output:**\n    ```\n    Enter the first number: 24\n    Enter the second number: 18\n    The GCD of 24 and 18 is 6.\n    ```\n\n21. **Question 21:**\n    **Question:** Write a C program to check if a user-entered number is a palindrome. A palindrome is a number that reads the same forwards and backwards.\n    **Expected Output:**\n    ```\n    Enter a number: 121\n    121 is a palindrome.\n    ```\n\n22. **Question 22:**\n    **Question:** Create a C program that prints a pattern of stars in the shape of a diamond using nested `for` loops.\n    **Expected Output:**\n    ```\n       *\n      ***\n     *****\n    *******\n     *****\n      ***\n       *\n    ```\n\n23. **Question 23:**\n    **Question:** Develop a program that generates and displays a random number between 1 and 100. Prompt the user to guess the number, and provide hints.\n    **Expected Output:**\n    ```\n    Guess the number (1-100): 50\n    Try higher.\n    Guess the number (1-100): 75\n    Try lower.\n    Guess the number (1-100): 63\n    Congratulations! You guessed the number (63).\n    ```\n\n24. **Question 24:**\n    **Question:** Write a C program that calculates the sum of the series 1 - 1/2 + 1/3 - 1/4 + ... - 1/n for a user-entered positive integer n.\n    **Expected Output:**\n    ```\n    Enter a positive integer (n): 5\n    The sum of the series is -0.78333.\n    ```\n\n25. **Question 25:**\n    **Question:** Create a C program that simulates a simple game of rock-paper-scissors. The user plays against the computer.\n    **Expected Output:**\n    ```\n    Choose your move (rock, paper, scissors): rock\n    Computer's move: scissors\n    You win!\n    ```\n\n26. **Question 26:**\n    **Question:** Develop a program that calculates the value of π using the Leibniz formula. Prompt the user for the number of terms (n) to use in the formula.\n    **Expected Output:**\n    ```\n    Enter the number of terms (n): 1000000\n    The value of π is approximately 3.14159.\n    ```\n\n27. **Question 27:**\n    **Question:** Write a C program that generates a random password of a specified length (e.g., 8 characters) containing a mix of letters (both uppercase and lowercase) and numbers.\n    **Expected Output:**\n    ```\n    Your random password: K4rW8p7X\n    ```\n\n28. **Question 28:**\n    **Question:** Create a C program that simulates a simple guessing game. The program generates a random number between 1 and 100, and the user must guess it within a limited number of attempts.\n    **Expected Output:**\n    ```\n    Guess the number (1-100). You have 5 attempts.\n    Attempt 1: 50\n    Try higher.\n    Attempt 2: 75\n    Try lower.\n    ...\n    Congratulations! You guessed the number (63) in 4 attempts.\n    ```\n\n29. **Question 29:**\n    **Question:** Develop a program that calculates the sum of all prime numbers between 1 and 100 using a `for` loop.\n    **Expected Output:**\n    ```\n    The sum of prime numbers between 1 and 100 is 1060.\n    ```\n\n30. **Question 30:**\n    **Question:** Write a C program that generates and displays a magic square of order 3. A magic square is a square matrix in which the sum of the numbers in each row, column, and both main diagonals is the same.\n    **Expected Output:**\n    ```\n    Magic Square:\n    2 7 6\n    9 5 1\n    4 3 8\n    ```\n\n31. **Question 31:**\n    **Question:** Create a C program that prints a right-angled triangle pattern of asterisks using nested `for` loops.\n    **Expected Output:**\n    ```\n    *\n    **\n    ***\n    ****\n    *****\n    ```\n\n32. **Question 32:**\n    **Question:** Develop a program that prints a hollow square pattern of asterisks with a user-specified side length.\n    **Expected Output:**\n    ```\n    Enter the side length of the square: 5\n    *****\n    *   *\n    *   *\n    *   *\n    *****\n    ```\n\n33. **Question 33:**\n    **Question:** Write a C program that prints a mirrored right-angled triangle pattern of numbers.\n    **Expected Output:**\n    ```\n        1\n       12\n      123\n     1234\n    12345\n    ```\n\n34. **Question 34:**\n    **Question:** Create a program that prints a pyramid pattern of asterisks with a user-specified height.\n    **Expected Output:**\n    ```\n        *\n       ***\n      *****\n     *******\n    *********\n    ```\n\n35. **Question 35:**\n    **Question:** Develop a C program that prints a diamond pattern of numbers with a user-specified number of rows.\n    **Expected Output:**\n    ```\n        1\n       121\n      12321\n     1234321\n    123454321\n     1234321\n      12321\n       121\n        1\n    ```\n\n36. **Question 36:**\n    **Question:** Write a C program that prints a right-angled triangle pattern of uppercase letters starting from 'A'.\n    **Expected Output:**\n    ```\n    A\n    AB\n    ABC\n    ABCD\n    ABCDE\n    ```\n\n37. **Question 37:**\n    **Question:** Create a program that prints a hollow right-angled triangle pattern of asterisks with a user-specified height.\n    **Expected Output:**\n    ```\n    Enter the height of the triangle: 5\n    *\n    **\n    * *\n    *  *\n    *****\n    ```\n\n38. **Question 38:**\n    **Question:** Develop a C program that prints an inverted pyramid pattern of numbers.\n    **Expected Output:**\n    ```\n    12345\n     1234\n      123\n       12\n        1\n    ```\n\n39. **Question 39:**\n    **Question:** Write a program that prints a square pattern of numbers with each row starting from 1 and incrementing by 1.\n    **Expected Output:**\n    ```\n    12345\n    12345\n    12345\n    12345\n    12345\n    ```\n\n40. **Question 40:**\n    **Question:** Create a C program that prints a pattern of the letter 'X' formed by asterisks.\n    **Expected Output:**\n    ```\n    *       *\n     *     *\n      *   *\n       * *\n        *\n       * *\n      *   *\n     *     *\n    *       *\n    ```\n\n41. **Question 41:**\n    **Question:** Write a C program to calculate the sum of the first 10 natural numbers using a `while` loop.\n    **Expected Output:**\n    ```\n    The sum of the first 10 natural numbers is 55.\n    ```\n\n42. **Question 42:**\n    **Question:** Create a C program that prints a hollow square pattern of asterisks with a user-specified side length.\n    **Expected Output:**\n    ```\n    Enter the side length of the square: 5\n    *****\n    *   *\n    *   *\n    *   *\n    *****\n    ```\n\n43. **Question 43:**\n    **Question:** Write a C program that checks if a given number is a power of two (2^n).\n    **Expected Output:**\n    ```\n    Enter a number: 16\n    16 is a power of 2.\n    ```\n\n44. **Question 44:**\n    **Question:** Create a C program to find the factorial of a user-entered number using a `while` loop.\n    **Expected Output:**\n    ```\n    Enter a number: 5\n    The factorial of 5 is 120.\n    ```\n\n45. **Question 45:**\n    **Question:** Develop a program that calculates the sum of all odd numbers from 1 to 100 using a `for` loop.\n    **Expected Output:**\n    ```\n    The sum of odd numbers from 1 to 100 is 2500.\n    ```\n\n46. **Question 46:**\n    **Question:** Write a C program that calculates the sum of the digits of a user-entered integer.\n    **Expected Output:**\n    ```\n    Enter an integer: 12345\n    The sum of the digits is 15.\n    ```\n\n47. **Question 47:**\n    **Question:** Create a program that calculates the LCM (Least Common Multiple) of two user-entered numbers.\n    **Expected Output:**\n    ```\n    Enter two numbers (separated by a space): 12 18\n    The LCM of 12 and 18 is 36.\n    ```\n\n48. **Question 48:**\n    **Question:** Develop a C program that checks if a user-entered string is a palindrome (reads the same forwards and backwards).\n    **Expected Output:**\n    ```\n    Enter a string: radar\n    \"radar\" is a palindrome.\n    ```\n\n49. **Question 49:**\n    **Question:** Write a C program that calculates the sum of all the multiples of 3 and 5 between 1 and 100.\n    **Expected Output:**\n    ```\n    The sum of multiples of 3 and 5 between 1 and 100 is 2418.\n    ```\n\n50. **Question 50:**\n    **Question:** Create a program that finds and displays the first N prime numbers.\n    **Expected Output:**\n    ```\n    Enter the value of N: 10\n    The first 10 prime numbers are: 2 3 5 7 11 13 17 19 23 29\n    ```\n\n51. **Question 51:**\n    **Question:** Develop a program that checks if a user-entered year is a leap year using a logical operator.\n    **Expected Output:**\n    ```\n    Enter a year: 2024\n    2024 is a leap year.\n    ```\n\n52. **Question 52:**\n    **Question:** Write a C program that calculates and displays the GCD (greatest common divisor) of two user-entered numbers.\n    **Expected Output:**\n    ```\n    Enter two numbers (separated by a space): 24 18\n    The GCD of 24 and 18 is 6.\n    ```\n\n53. **Question 53:**\n    **Question:** Create a program that calculates the sum of squares of the first N natural numbers.\n    **Expected Output:**\n    ```\n    Enter the value of N: 4\n    The sum of squares of the first 4 natural numbers is 30.\n    ```\n\n54. **Question 54:**\n    **Question:** Develop a program that finds the smallest and largest elements in an array of integers.\n    **Expected Output:**\n    ```\n    Enter the number of elements in the array: 6\n    Enter the elements (separated by spaces): 18 7 42 10 31 55\n    The smallest element in the array is 7, and the largest element is 55.\n    ```\n\n55. **Question 55:**\n    **Question:** Write a C program that generates and displays a random password of a specified length (e.g., 8 characters) using a logical approach.\n    **Expected Output:**\n    ```\n    Your random password: K4rW8p7X\n    ```\n\n56. **Question 56:**\n    **Question:** Create a program that checks if a user-entered number is a perfect number.\n    **Expected Output:**\n    ```\n    Enter a number: 28\n    28 is a perfect number.\n    ```\n\n57. **Question 57:**\n    **Question:** Develop a C program that prints a pattern of stars in the shape of a right-angled triangle using nested `for` loops.\n    **Expected Output:**\n    ```\n    *\n    **\n    ***\n    ****\n    *****\n    ```\n\n58. **Question 58:**\n    **Question:** Write a program that calculates the sum of even numbers between 1 and 50 using a `while` loop.\n    **Expected Output:**\n    ```\n    The sum of even numbers from 1 to 50 is 650.\n    ```\n\n59. **Question 59:**\n    **Question:** Create a C program that checks if a given number is a palindrome using a logical approach.\n    **Expected Output:**\n    ```\n    Enter a number: 121\n    121 is a palindrome.\n    ```\n\n60. **Question 60:**\n    **Question:** Write a C program that checks if a user-entered string is a palindrome using logical operations.\n    **Expected Output:**\n    ```\n    Enter a string: radar\n    \"radar\" is a palindrome.\n    ```\n\n61. **Question 61:**\n    **Question:** Develop a C program that finds and displays the first N Fibonacci numbers.\n    **Expected Output:**\n    ```\n    Enter the value of N: 8\n    The first 8 Fibonacci numbers are: 0 1 1 2 3 5 8 13\n    ```\n\n62. **Question 62:**\n    **Question:** Write a C program to reverse a user-entered string without using any built-in string functions.\n    **Expected Output:**\n    ```\n    Enter a string: programming\n    Reversed string: gnimmargorp\n    ```\n\n63. **Question 63:**\n    **Question:** Create a program that checks if a given year is a leap year or not using a logical approach.\n    **Expected Output:**\n    ```\n    Enter a year: 2100\n    2100 is not a leap year.\n    ```\n\n64. **Question 64:**\n    **Question:** Develop a C program that calculates the product of digits in a user-entered integer.\n    **Expected Output:**\n    ```\n    Enter an integer: 12345\n    The product of the digits is 120.\n    ```\n\n65. **Question 65:**\n    **Question:** Write a program that determines if a user-entered number is prime or composite.\n    **Expected Output:**\n    ```\n    Enter a number: 17\n    17 is a prime number.\n    ```\n\n66. **Question 66:**\n    **Question:** Create a C program that counts and displays the number of words in a user-entered sentence.\n    **Expected Output:**\n    ```\n    Enter a sentence: This is a sample sentence.\n    The number of words in the sentence is 5.\n    ```\n\n67. **Question 67:**\n    **Question:** Develop a program that calculates the sum of all natural numbers divisible by 3 or 5 between 1 and 100.\n    **Expected Output:**\n    ```\n    The sum of natural numbers divisible by 3 or 5 between 1 and 100 is 2418.\n    ```\n\n68. **Question 68:**\n    **Question:** Write a C program to check if a user-entered number is an Armstrong number (narcissistic number).\n    **Expected Output:**\n    ```\n    Enter a number: 153\n    153 is an Armstrong number.\n    ```\n\n69. **Question 69:**\n    **Question:** Create a program that calculates the area of a triangle when the user provides the lengths of its three sides.\n    **Expected Output:**\n    ```\n    Enter the lengths of three sides (separated by spaces): 5 12 13\n    The area of the triangle is 30 square units.\n    ```\n\n70. **Question 70:**\n    **Question:** Develop a C program to check if a user-entered number is a strong number.\n    **Expected Output:**\n    ```\n    Enter a number: 145\n    145 is a strong number.\n    ```\n\n71. **Question 71:**\n    **Question:** Write a C program that checks if a user-entered number is a palindrome using a logical approach.\n    **Expected Output:**\n    ```\n    Enter a number: 121\n    121 is a palindrome.\n    ```\n\n72. **Question 72:**\n    **Question:** Create a program that calculates the sum of squares of the first N even natural numbers.\n    **Expected Output:**\n    ```\n    Enter the value of N: 4\n    The sum of squares of the first 4 even natural numbers is 120.\n    ```\n\n73. **Question 73:**\n    **Question:** Develop a C program that checks if a user-entered year is a leap year without using logical operators.\n    **Expected Output:**\n    ```\n    Enter a year: 2024\n    2024 is a leap year.\n    ```\n\n74. **Question 74:**\n    **Question:** Write a program that calculates the sum of cubes of the first N odd natural numbers.\n    **Expected Output:**\n    ```\n    Enter the value of N: 5\n    The sum of cubes of the first 5 odd natural numbers is 135.\n    ```\n\n75. **Question 75:**\n    **Question:** Create a C program that checks if a user-entered string is a pangram (contains all English alphabet letters).\n    **Expected Output:**\n    ```\n    Enter a string: The quick brown fox jumps over the lazy dog.\n    The string is a pangram.\n    ```\n\n76. **Question 76:**\n    **Question:** Develop a program that calculates and displays the HCF (Highest Common Factor) of two user-entered numbers.\n    **Expected Output:**\n    ```\n    Enter two numbers (separated by a space): 24 36\n    The HCF of 24 and 36 is 12.\n    ```\n\n77. **Question 77:**\n    **Question:** Write a C program that calculates the sum of the squares of prime numbers between 1 and 50.\n    **Expected Output:**\n    ```\n    The sum of squares of prime numbers between 1 and 50 is 2418.\n    ```\n\n78. **Question 78:**\n    **Question:** Create a program that checks if a user-entered number is an abundant number.\n    **Expected Output:**\n    ```\n    Enter a number: 12\n    12 is an abundant number.\n    ```\n\n79. **Question 79:**\n    **Question:** Develop a C program that checks if a given string is a palindrome using pointers.\n    **Expected Output:**\n    ```\n    Enter a string: racecar\n    \"racecar\" is a palindrome.\n    ```\n\n80. **Question 80:**\n    **Question:** Write a program that calculates the sum of digits of a user-entered number using a logical approach.\n    **Expected Output:**\n    ```\n    Enter a number: 12345\n    The sum of the digits is 15.\n    ```\n\n81. **Question 81:**\n    **Question:** Create a C program to find and display the prime factors of a user-entered number.\n    **Expected Output:**\n    ```\n    Enter a number: 60\n    The prime factors of 60 are: 2 3 5\n    ```\n\n82. **Question 82:**\n    **Question:** Develop a program that calculates the difference between the sum of squares and the square of the sum of the first N natural numbers.\n    **Expected Output:**\n    ```\n    Enter the value of N: 5\n    The difference is 170.\n    ```\n\n83. **Question 83:**\n    **Question:** Write a C program that checks if a user-entered number is a strong number using logical operations.\n    **Expected Output:**\n    ```\n    Enter a number: 145\n    145 is a strong number.\n    ```\n\n84. **Question 84:**\n    **Question:** Create a program that calculates and displays the LCM (Least Common Multiple) of three user-entered numbers.\n    **Expected Output:**\n    ```\n    Enter three numbers (separated by spaces): 12 18 24\n    The LCM of 12, 18, and 24 is 72.\n    ```\n\n85. **Question 85:**\n    **Question:** Develop a C program that calculates the sum of natural numbers divisible by both 3 and 5 between 1 and 100.\n    **Expected Output:**\n    ```\n    The sum of natural numbers divisible by both 3 and 5 between 1 and 100 is 315.\n    ```\n\n86. **Question 86:**\n    **Question:** Write a program that checks if a user-entered number is a Kaprekar number.\n    **Expected Output:**\n    ```\n    Enter a number: 9\n    9 is a Kaprekar number.\n    ```\n\n87. **Question 87:**\n    **Question:** Create a C program to find the sum of the series: 1 + 1/4 + 1/9 + 1/16 + ... + 1/n^2.\n    **Expected Output:**\n    ```\n    Enter the value of n: 4\n    The sum of the series is approximately 1.42361.\n    ```\n\n88. **Question 88:**\n    **Question:** Develop a program that checks if a user-entered sentence is a palindrome (ignoring spaces and case).\n    **Expected Output:**\n    ```\n    Enter a sentence: A man, a plan, a canal, Panama.\n    The sentence is a palindrome.\n    ```\n\n89. **Question 89:**\n    **Question:** Write a C program that calculates and displays the difference between the sum of even-indexed elements and odd-indexed elements in an array.\n    **Expected Output:**\n    ```\n    Enter the number of elements in the array: 5\n    Enter the elements (separated by spaces): 4 7 2 9 6\n    The difference is 7.\n    ```\n\n90. **Question 90:**\n    **Question:** Create a program that calculates the value of π using the Monte Carlo method for a user-specified number of iterations.\n    **Expected Output:**\n    ```\n    Enter the number of iterations: 1000000\n    The value of π is approximately 3.14159.\n    ```\n\n91. **Question 91:**\n    **Question:** Write a C program that generates the first N prime numbers and displays them in a spiral pattern.\n    **Expected Output:**\n    ```\n    Enter the value of N: 10\n    Prime Numbers in a Spiral:\n    17 16 15 14 13\n    18  5  4  3 12\n    19  6  1  2 11\n    20  7  8  9 10\n    21 22 23 24 25\n    ```\n\n92. **Question 92:**\n    **Question:** Create a program that simulates a basic ATM machine. The user can withdraw, deposit, or check the balance.\n    **Expected Output:** (Interaction example)\n    ```\n    Welcome to the ATM!\n    Select an option:\n    1. Withdraw\n    2. Deposit\n    3. Check Balance\n    4. Exit\n    Enter your choice: 1\n    Enter the amount to withdraw: 100\n    Successfully withdrawn $100. Current balance: $900\n    ```\n\n93. **Question 93:**\n    **Question:** Develop a C program that simulates a simple tic-tac-toe game for two players.\n    **Expected Output:** (Sample game interaction)\n    ```\n    Player 1, enter your move (row and column): 2 1\n    Board after move:\n    1 - -\n    X - -\n    - - -\n    Player 2, enter your move (row and column): 1 2\n    Board after move:\n    1 O -\n    X - -\n    - - -\n    ...\n    ```\n\n94. **Question 94:**\n    **Question:** Write a C program to find and display the longest word in a user-entered sentence.\n    **Expected Output:**\n    ```\n    Enter a sentence: The quick brown fox jumps over the lazy dog.\n    The longest word in the sentence is \"jumps\".\n    ```\n\n95. **Question 95:**\n    **Question:** Create a program that generates a random maze and finds a path from the start to the end point.\n    **Expected Output:**\n    ```\n    Random Maze:\n    # # # # # # # # # # #\n    S       #   #       #\n    # # #   # # #   # # #\n    #   #   #       #   #\n    #   # # #   # # # # #\n    #   #           #   E\n    # # # # # # # # # # #\n    Path:\n    S   * * * * * *   *\n        *       #   * #\n    # # #   # # #   # #\n    #   #   #       # #\n    #   # # #   # # # #\n    #   #           # *\n    # # # # # # # # # #\n    ```\n\n96. **Question 96:**\n    **Question:** Develop a C program that simulates a simple Blackjack card game between the user and the computer.\n    **Expected Output:** (Sample game interaction)\n    ```\n    Welcome to Blackjack!\n    Player's Hand: 7 9\n    Computer's Hand: 5 ?\n    Do you want to hit or stand? (h/s): h\n    Player's Hand: 7 9 Q\n    ...\n    ```\n\n97. **Question 97:**\n    **Question:** Write a program to calculate the sum of prime numbers in the Fibonacci sequence up to a user-entered limit.\n    **Expected Output:**\n    ```\n    Enter the limit: 50\n    The sum of prime Fibonacci numbers up to 50 is 104.\n    ```\n\n98. **Question 98:**\n    **Question:** Create a C program that counts the number of occurrences of each word in a user-entered text document.\n    **Expected Output:** (Sample input and output)\n    ```\n    Enter the text:\n    This is a sample text. This is a sample document.\n    Word Count:\n    \"This\" occurs 2 times.\n    \"is\" occurs 2 times.\n    \"a\" occurs 2 times.\n    \"sample\" occurs 2 times.\n    \"text.\" occurs 1 time.\n    \"document.\" occurs 1 time.\n    ```\n\n99. **Question 99:**\n    **Question:** Develop a program that calculates and displays the sum of digits of factorial of a user-entered number.\n    **Expected Output:**\n    ```\n    Enter a number: 5\n    The sum of digits of 5! is 3.\n    ```\n\n100. **Question 100:**\n    **Question:** Write a C program that generates and displays the first N numbers of the Lucas sequence.\n    **Expected Output:**\n    ```\n    Enter the value of N: 8\n    The first 8 Lucas numbers are: 2 1 3 4 7 11 18 29\n    ```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpankaj-str%2Fc-interview-questions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpankaj-str%2Fc-interview-questions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpankaj-str%2Fc-interview-questions/lists"}