Home‎ > ‎

Assignment-3

CS101                                      Assignment-3                               2010-2011

 

PROGRAMMING IN C

 

1.                  Write your own C program to implement the atoi() function

2.                  Implement the memmove() function. What is the difference between the memmove() and memcpy() function?

3.                  Write C code to implement the strstr() (search for a substring) function.

4.                  Write your own printf() function in C

5.                  Implement the strcpy() function.

6.                  Implement the strcmp(str1, str2) function.

7.                  Implement the substr() function in C.

8.                  Write your own copy() function

9.                  Write C programs to implement the toupper() and the isupper() functions

10.              Write a C program to implement your own strdup() function.

11.              Write a C program to implement the strlen() function

12.              Write your own strcat() function

13.              Write a C program to swap two variables without using a temporary variable

14.              What is the 8 queens problem? Write a C program to solve it.

15.              Write a C program to print a square matrix helically.

16.              Write a C program to reverse a string

17.              Write a C program to reverse the words in a sentence in place.

18.              Write a C program generate permutations.

19.              Write a C program for calculating the factorial of a number

20.              Write a C program to calculate pow(x,n)?

21.              Write a C program which does wildcard pattern matching algorithm

22.              How do you calculate the maximum subarray of a list of numbers?

23.              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.

24.              Solve the Rat In A Maze problem using backtracking.

25.              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?

26.              Write C code to solve the Tower of Hanoi problem.

27.              Write C code to return a string from a function

28.              Write a C program which produces its own source code as its output

29.              Write a C progam to convert from decimal to any base (binary, hex, oct etc...)

30.              Write C code to check if an integer is a power of 2 or not in a single line?

31.              Write a C program to find the GCD of two numbers.

32.              Finding a duplicated integer problem

33.              Write code to remove duplicates in a sorted array.

34.              Find the maximum of three integers using the ternary operator.

35.              How do you initialize a pointer inside a function?

36.              Write C code to dynamically allocate one, two and three dimensional arrays (using malloc())

37.              How would you find the size of structure without using sizeof()?

38.              Write a C program to multiply two matrices.

39.              Write a C program to check for palindromes.

40.              Write a C program to convert a decimal number into a binary number.

41.              Write C code to implement the Binary Search algorithm.

42.              Wite code to evaluate a polynomial.

43.              Write code to add two polynomials

44.              Write a program to add two long positive numbers (each represented by linked lists).

45.              How do you compare floating point numbers?

46.              What's a good way to implement complex numbers in C?

47.              How can I display a percentage-done indication on the screen?

48.              Write a program to check if a given year is a leap year or not?

49.              Is there something we can do in C but not in C++?

50.              How to swap the two nibbles in a byte ?

51.              How to scan a string till we hit a new line using scanf()?

52.              Write pseudocode to compare versions (like 115.10.1 vs 115.11.5).

53.              How do you get the line numbers in C?

54.              How to fast multiply a number by 7?

55.              Write a simple piece of code to split a string at equal intervals

56.              Is there a way to multiply matrices in lesser than o(n^3) time complexity?

57.              How do you find out if a machine is 32 bit or 64 bit?

58.              Write a program to have the output go two places at once (to the screen and to a file also)

59.              Write code to round numbers

60.              How can we sum the digits of a given number in single statement?

61.              Given two strings A and B, how would you find out if the characters in B were a subset of the characters in A?

62.              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. *

63.              Write a program to check if the stack grows up or down

64.              How to add two numbers without using the plus operator?

65.              How to generate prime numbers? How to generate the next prime after a given prime?

66.              Write a program to print numbers from 1 to 100 without using loops!

67.              Write your own trim() or squeeze() function to remove the spaces from a string.

68.              Write your own random number generator function in C.*

69.        Write your own sqrt() function in C 

Ċ
Kapil Sharma,
Nov 13, 2011, 2:03 AM
Comments