c progs

Download c progs

If you can't read please download the document

Upload: sudeep-mishra

Post on 16-Sep-2015

217 views

Category:

Documents


2 download

DESCRIPTION

c

TRANSCRIPT

1.wap to find the number of currency notes in a given amount of money eg: rs 689 (* currency notes are 500,100,50,10,1 ) 500+100+50+(3*10)+(9*1) count=15 currency notes2.wap to no of digits in given number eg:784 ans:33.wap to find the average of multiples of 5 upto n given natural numbers (OR) between 10 to 1004.wap to find the average of n real numbers5.wap to find Strong numbers upto n natural numbers6.wap to find the Perfect number upto n natural numbers7.wap to find the repetition of given number in an array eg:input1={1,2,2,2,4,3,3} input2=7(array size) input3=2(to find how many times the element 2 is repetiting in given array )8.wap to check whether the given number is Palindrome or not9.wap to find decimal for given binarynumber and vice versa10.wap to remove the duplicates in array and display the resultant array11.wap to find the sum of elements in two arrays condition: first element of array1 is added with last element of second array,second element of first array is added with element which is previous to last element of second array an so on... eg: a1[]={1,3,4,2,17} a2[]={4,5,6,7,8} output[]={9,10,10,7,21}12.wap to sort the array and insert a new element into it and sort it and find if any element is -ve insert -1 to the first element of array={-1,0,0,0,0}; eg: {5,6,4,3,8,7,12,11} sorted array:{3,4,5,6,7,8,11,12} 9 is to be inserted {3,4,5,6,7,8,9,11,12}13.wap to sort the given array in ascending order till the half of array and in descending order after the half eg:{4,6,2,3,8,12,14,9} output={2,3,4,6,14,12,9,8}14.wap to find product of digits of a given number15.wap to find factorial of a given number16. wap to search a number in an array (Linear search)17.wap to find Armstrong number for the given input.18.wap to find sum of average of Prime numbers up to n numbers19.wap to convert a given number from celcius to farenheit or vice versa20.wap to find sum of square of Prime numbers upto n numbers21.wap to get the product of duplicates element in an array22.wap to find sum of n natural even numbers23.wap to delete the negative number from input array and store positive numbrs alone in output array24.wap to find sum of cube of prime numbers upto n numbers25.wap to find sum of n natural odd numbers26.wap to Find prime numbers in the given array {2,3,4,5,6,7} and if it s prime sum the prime numbers27.wap to find leap year or not28.wap to find average of multiples of a given numbers from 1 to n29.wap to find the number is Perfect number or not30.wap to print the consecutive numbers. eg: array{10,13,18}; print{11,14,19};31.If given array1={2,3,4,5,6}, array2={1,40,4,3,8}, compare the 1st element of array1 with 1st element of array2nd, 2nd element of array1 with 2nd element of array2 and so on.... your result array should be displayed as this {2,40,4,5,8}32.wap to check whether the given number is perfect square or not