• Write Your Own Programs
o Write your own C program to implement the atoi() function
o Implement the memmove() function. What is the difference between the memmove() and memcpy() function?
o Write C code to implement the strstr() (search for a substring) function.
o Write your own printf() function in C
o Implement the strcpy() function.
o Implement the strcmp(str1, str2) function.
o Implement the substr() function in C.
o Write your own copy() function
o Write C programs to implement the toupper() and the isupper() functions
o Write a C program to implement your own strdup() function.
o Write a C program to implement the strlen() function
o Write your own strcat() function
• C
o Write a C program to swap two variables without using a temporary variable
o What is the 8 queens problem? Write a C program to solve it.
o Write a C program to print a square matrix helically.
o Write a C program to reverse a string
o Write a C program to reverse the words in a sentence in place.
o Write a C program generate permutations.
o Write a C program for calculating the factorial of a number
o Write a C program to calculate pow(x,n)?
o Write a C program which does wildcard pattern matching algorithm
o How do you calculate the maximum subarray of a list of numbers?
o How to generate Fibonacci numbers? How to find out if a given number is a Fibonacci number or not? Write C programs to do both.
o Solve the Rat In A Maze problem using backtracking.
o What Little-Endian and Big-Endian? How can I determine whether a machine's byte order is big-endian or little endian? How can we convert from one to another?
o Write C code to solve the Tower of Hanoi problem.
o Write C code to return a string from a function
o Write a C program which produces its own source code as its output
o Write a C progam to convert from decimal to any base (binary, hex, oct etc...)
o Write C code to check if an integer is a power of 2 or not in a single line?
o Write a C program to find the GCD of two numbers.
o Finding a duplicated integer problem
o Write code to remove duplicates in a sorted array.
o Find the maximum of three integers using the ternary operator.
o How do you initialize a pointer inside a function?
o Write C code to dynamically allocate one, two and three dimensional arrays (using malloc())
o How would you find the size of structure without using sizeof()?
o Write a C program to multiply two matrices.
o Write a C program to check for palindromes.
o Write a C program to convert a decimal number into a binary number.
o Write C code to implement the Binary Search algorithm.
o Wite code to evaluate a polynomial.
o Write code to add two polynomials
o Write a program to add two long positive numbers (each represented by linked lists).
o How do you compare floating point numbers?
o What's a good way to implement complex numbers in C?
o How can I display a percentage-done indication on the screen?
o Write a program to check if a given year is a leap year or not?
o Is there something we can do in C but not in C++?
o How to swap the two nibbles in a byte ?
o How to scan a string till we hit a new line using scanf()?
o Write pseudocode to compare versions (like 115.10.1 vs 115.11.5).
o How do you get the line numbers in C?
o How to fast multiply a number by 7?
o Write a simple piece of code to split a string at equal intervals
o Is there a way to multiply matrices in lesser than o(n^3) time complexity?
o How do you find out if a machine is 32 bit or 64 bit?
o Write a program to have the output go two places at once (to the screen and to a file also)
o Write code to round numbers
o How can we sum the digits of a given number in single statement?
o Given two strings A and B, how would you find out if the characters in B were a subset of the characters in A?
o Write a program to merge two arrays in sorted order, so that if an integer is in both the arrays, it gets added into the final array only once. *
o Write a program to check if the stack grows up or down
o How to add two numbers without using the plus operator?
o How to generate prime numbers? How to generate the next prime after a given prime?
o Write a program to print numbers from 1 to 100 without using loops!
o Write your own trim() or squeeze() function to remove the spaces from a string.
o Write your own random number generator function in C.*
o Write your own sqrt() function in C*
• Sorting Techniques Programs
o What is heap sort?
o What is the difference between Merge Sort and Quick sort?
o Give pseudocode for the mergesort algorithm
o Implement the bubble sort algorithm. How can it be improved? Write the code for selection sort, quick sort, insertion sort.
o How can I sort things that are too large to bring into memory?
• C Pointers Programs
o What does *p++ do? Does it increment p or the value pointed by p?
o What is a NULL pointer? How is it different from an unitialized pointer? How is a NULL pointer defined?
o What is a null pointer assignment error?
o Does an array always get converted to a pointer? What is the difference between arr and &arr? How does one declare a pointer to an entire array?
o Is the cast to malloc() required at all?
o What does malloc() , calloc(), realloc(), free() do? What are the common problems with malloc()? Is there a way to find out how much memory a pointer was allocated?
o What's the difference between const char *p, char * const p and const char * const p?
o What is a void pointer? Why can't we perform arithmetic on a void * pointer?
o What do Segmentation fault, access violation, core dump and Bus error mean?
o What is the difference between an array of pointers and a pointer to an array?
o What is a memory leak?
o What are brk() and sbrk() used for? How are they different from malloc()?
o What is a dangling pointer? What are reference counters with respect to pointers?
o What do pointers contain?
o Is *(*(p+i)+j) is equivalent to p[i][j]? Is num[i] operator?
o Can we pass constant values to functions which accept structure arguments?
o How does one use fread() and fwrite()? Can we read/write structures to/from files?
o Why do structures get padded? Why does sizeof() return a larger size?
o Can we determine the offset of a field within a structure and directly access that element?
o What are bit fields in structures?
o What is a union? Where does one use unions? What are the limitations of unions?
• C Macros Programs
o How should we write a multi-statement macro?
o How can I write a macro which takes a variable number of arguments?
o What is the token pasting operator and stringizing operator in C?
o Define a macro called SQR which squares a number.
• C Headers Programs
o What should go in header files? How to prevent a header file being included twice? Whats wrong with including more headers?
o Is there a limit on the number of characters in the name of a header file?
o Is it acceptable to declare/define a variable in a C header?
• C File operations Programs
o How do stat(), fstat(), vstat() work? How to check whether a file exists?
o How can I insert or delete a line (or record) in the middle of a file?
o How can I recover the file name using its file descriptor?
o How can I delete a file? How do I copy files? How can I read a directory in a C program?
o Whats the use of fopen(), fclose(), fprintf(), getc(), putc(), getw(), putw(), fscanf(), feof(), ftell(), fseek(), rewind(), fread(), fwrite(), fgets(), fputs(), freopen(), fflush(), ungetc()?
o How to check if a file is a binary file or an ascii file?
• C Declarations and Definitions Programs
o What is the difference between char *a and char a[]?
o How can I declare an array with only one element and still access elements beyond the first element (in a valid fashion)?
o What is the difference between enumeration variables and the preprocessor #defines?
• C Functions - built-in Programs
o Whats the difference between gets() and fgets()? Whats the correct way to use fgets() when reading a file?
o How can I have a variable field width with printf?
o How can I specify a variable width in a scanf() format string?
o How can I convert numbers to strings (the opposite of atoi)?
o Why should one use strncpy() and not strcpy()? What are the problems with strncpy()?
o How does the function strtok() work?
o Why do we get the floating point formats not linked error?
o Why do some people put void cast before each call to printf()?
o What is assert() and when would I use it?
o What do memcpy(), memchr(), memcmp(), memset(), strdup(), strncat(), strcmp(), strncmp(), strcpy(), strncpy(), strlen(), strchr(), strchr(), strpbrk(), strspn(), strcspn(), strtok() do?
o What does alloca() do?
o Can you compare two strings like string1==string2? Why do we need strcmp()?
o What does printf() return?
o What do setjmp() and longjump() functions do?
• C Functions - The main function Programs
o Whats the prototype of main()? Can main() return a structure?
o Is exit(status) equivalent to returning the same status from main()?
o Can main() be called recursively?
o How to print the arguments received by main()?
Some C programs can be compiled in C++, yes.
C programs don't contain flowcharts.
A programmer can write programs in C, but C can't write anything by itself.
You will be able to understand C programs. Also to write C programs.
You can find C programs at http://talentsealed.blogspot.com.
C programs can be compiled with a C compiler. Are you surprised?
A C++ program can be used to write C programs that will display 10 lines of biodata. Many types of C programming can be written with a C++ program.
Yes.
No, but source-programs written in C language are.
The C language (or more commonly C++) is the core of most programming done at the desktop level. Most programs written in Linux are in C or C++, as are most Windows programs. A number of languages in recent computer history have been designed to reduce the dependency on C and C++, but have still largely failed to replace C and C++ for high performance applications.
What's about them?
Human activity that ends in producing C++ programs.