C Debugging Challenges

Five C programming challenges from a debugging event. Debug the buggy code using the problem statement.

Challenge 1

Armstrong Number

Given an integer, check if it is an Armstrong number. If yes, print the digital root (sum of digits until single digit); otherwise print the number itself.

Challenge 2

Number Pattern

Print a diamond-shaped number pattern based on input N. Numbers start from 2 in each row, expanding then contracting.

Challenge 3

Set Union

Given two predefined integer arrays of size 10, compute and print their union without duplicates.

Challenge 4

Binary Search with Offset

Binary search on a predefined sorted array. Print index + 10 if found, else print "Element is not present in array".

Challenge 5

Factorial + Fibonacci

Print factorial of N followed by the Fibonacci series up to N terms, each number followed by a space.

View on GitHub