You are on page 1of 3

C Assignments DAY-1

1. Write a program to find the angle [Degree] between two needles in a clock Hints: input hours and min Example Hr !" #n 1$" Deg $% $. Write a program: a& 'o check (i)en *o is prime +r not b& 'o check (i)en *o is ,rmstrong *umber or not c& 'o check gi)en *umber is perfect *umber or not Hint:1. ,rmstrong *umber #eans" -um of" .ube of the each digit in a number is e/ui)alent to the same *umber. 0or example: 11! cube21& 3cube21&3cube2!& 1 3 1$1 3 $4 11! $. 5erfect *umber #eans : sum of factors of a *umber is" e/ui)alent to the same *umber *ote: 6gnore *umber it is as a factor. Example: i& 7 0actors of 7 are 1"$"! 13$3! 7 ii& $8 factors are 1"$"%"4"1% 13$3%3431% $8 5erfect numbers are end with either 7 or 8

!. Write a program to find the difference between two different dates Example: month1 1$ 9ear1 $::% date1 !1 month$ ! 9ear$ $::1 date$ 1 no of da9s 7$ *ote: 'here is no predefined function in . for this %. 6mplement binar9 search. 1. 6mplement insertion sort.

7. (i)en an arra9 of names" sort the names in alphabetical order. 4. Write a program to concatenate $ strings without using string functions. 8. Write a program to find -econd biggest ,nd -econd -mallest of (i)en * *umber [ note :without using sorting algorithms] ;.Write a program to search a word in a paragraph<sentence i& print how man9 times it present ii& replace seaching word with =>? searching word :wipro example: Wipro ec% wipro # ( @oad Wipro #1 after replacement >>>>> ec% >>>>> # ( @oad >>>>> #1 1:. Write a program to re)erse an integer and a string without using in built functions 11. , program to ask for the login and password" check for authentication. 1$. @eading a number 2from 1 to ;;;& in words and printing it in digits. 1!. Write a program insert<delete in a single dimension arra9. 1%. Write a program to e)aluate following expression[using arra9 multiplication<addition] $,>1A3 .B 7D >1. 11. Write a program to find (.D and C.# of gi)en two *umber 2using function&

DAY-2
17. Write a program to e)aluate the following series i& 13$<$D 3!<!D 3 EE.3n<nD ii& 13!<%D F 1<7D 3 4<8 B 3En<2n31&D +r -ine series<cos series 14. Write ! different functions" each function should recei)e a $BD arra9 in a different wa9 and print the arra9. 18. Write a program to find out max and min number in an arra9 gi)en using recursion.

1;. Write a recursi)e procedure to find the sum of all elements in a gi)en arra9. $:. Write a program to read a line of text and re)erse using recursion. $1. Write a program that con)erts upper case to lower or lower case to upper" depending +n the name it is in)oked with" as found in arg)[1]. $$. .onsider a file which contains fields similar to a phone director9 .(i)en a phone number" search for the existence of the number in the file and print out the name of the subscriber. $!. Write a program to compare two files" printing the first line where the9 differ. $%. -imulate the cat command of Gnix $1. Write a function that returns a substring from a string .

You might also like