C
50 Classic C Problems
Prime numbers, Armstrong numbers, bubble sort: the problems everyone practises. Write right away; get one wrong and Wick shows you how your code really runs.
New to this? Start the C course →0 / 50 solved
Get your certificateA certificate with your name: download it, share it, or add it to LinkedIn in one click.Get your certificate →
C50 Classic C Problems 50PyPython starterPyPython next stepsSQLSQLSQLSQL InterviewCC starterC++C++ starterGoGo starter
Conditions0 / 8
#0011. Swap two numberst = a; a = b; b = t;Starter3 min#0022. Even or oddn % 2 == 0Starter2 min#0033. Largest of threeif (b > max)Starter3 min#0044. Leap yearyear % 400 == 0Starter4 min#0055. Letter gradescore >= 90 ? 'A'Basic4 min#0066. Simple calculatorcase '-':Basic5 min#0077. Quadratic equationb * b - 4 * a * cBasic8 min#0088. Profit bonus(profit - 200000) * 0.05Mini challenge10 minNumbers0 / 21
#0099. Multiplication tablej <= iStarter5 min#01010. Factorialf *= iStarter3 min#01111. Sum of factorialssum += fBasic5 min#01212. Fibonacci rabbitsf1 + f2Starter5 min#01313. Check prime numbern % i == 0Starter5 min#01414. Primes from 101 to 200prime = 0Starter6 min#01515. Armstrong numbersa*a*a + b*b*b + c*c*cStarter6 min#01616. Perfect numberssum += iStarter6 min#01717. GCD and LCMa % bBasic6 min#01818. Prime factorizationwhile (n % i == 0)Basic8 min#01919. Reverse a numberr * 10 + n % 10Starter5 min#02020. Palindrome numberr == nStarter6 min#02121. Unique 3-digit numbersa != b && a != c && b != cStarter5 min#02222. Perfect square puzzleis_square(x + 100) && is_square(x + 268)Basic6 min#02323. Hundred chickensz % 3 == 0Basic8 min#02424. Monkey and peachesx = (x + 1) * 2Starter5 min#02525. Bouncing balltotal += 2 * hBasic6 min#02626. Fraction series sum(double)a / bBasic7 min#02727. Sum a + aa + aaaterm * 10 + aStarter5 min#02828. Day of the yearyear % 100 != 0Basic8 min#02929. Count character typesc >= '0' && c <= '9'Basic7 minPatterns0 / 3
#03030. Print a pyramidj < 2 * i - 1Starter6 min#03131. Print a diamondrow(n - i, 2 * i - 1)Basic8 min#03232. Pascal's trianglet[i - 1][j - 1] + t[i - 1][j]Basic8 minArrays0 / 8
#03333. Bubble sorta[j] > a[j + 1]Basic8 min#03434. Selection sorta[j] < a[min]Basic8 min#03535. Reverse an arraya[i] = a[j]Starter5 min#03636. Insert into sorted arraya[i + 1] = a[i]Basic8 min#03737. Binary searchlo = mid + 1Basic8 min#03838. Matrix diagonal summ[i][i]Starter5 min#03939. Transpose a matrixb[j][i] = a[i][j]Starter5 min#04040. Max and its indexa[i] > a[best]Starter4 minStrings0 / 5
#04141. Reverse a stringj = strlen(s) - 1Basic6 min#04242. Count wordsin_word == 0Basic8 min#04343. Length without strlens[n] != '\0'Starter4 min#04444. Swap letter cases[i] - 'a' + 'A'Basic5 min#04545. Palindrome strings[i] != s[j]Basic5 minRecursion0 / 3
#04646. Recursive factorialn * fact(n - 1)Basic4 min#04747. Tower of Hanoihanoi(n - 1, from, to, via)Mini challenge10 min#04848. Print string in reversereverse_print(s + 1)Basic6 minPointers0 / 2
#04949. Swap with pointers*a = *bBasic5 min#05050. Sort students by scorestruct Student t = s[j]Mini challenge10 minNothing matches. Try another filter.