C Programming Interview Questions
C Programming Interview Questions
Reverse a String
#include <stdio.h>
#include <string.h>
int n = strlen(str);
str[n - i - 1] = temp;
int main() {
reverseString(str);
return 0;
#include <stdio.h>
#include <stdbool.h>
return true;
int main() {
if (isPrime(num)) {
} else {
return 0;
Fibonacci Series
#include <stdio.h>
void fibonacci(int n) {
int a = 0, b = 1, next;
next = a + b;
a = b;
b = next;
}
printf("\n");
int main() {
int n = 10;
fibonacci(n);
return 0;
#include <stdio.h>
max = arr[i];
return max;
int main() {
return 0;
#include <stdio.h>
#include <string.h>
if (temp == NULL) {
exit(1);
memcpy(temp, a, size);
memcpy(a, b, size);
free(temp);
void bubbleSort(void *arr, size_t n, size_t size, int (*cmp)(const void *, const void *)) {
if (cmp(a, b) > 0) {
swap(a, b, size);
}
int main() {
printf("\n");
return 0;
#include <stdio.h>
int gcd(int a, int b) {
while (b != 0) {
int temp = b;
b = a % b;
a = temp;
return a;
int main() {
return 0;
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
int l = 0;
int h = strlen(str) - 1;
while (h > l) {
if (str[l++] != str[h--]) {
return false;
}
return true;
int main() {
if (isPalindrome(str)) {
} else {
return 0;