Anda di halaman 1dari 4

1.

Write C program which read two strings and concatenate the largest string to the smallest string (among the two strings). Make necessary assumption. Do not u se standard available functions of C. 2. (a) Write a C program which find the length of a given string (Do not use lib rary function for finding string length). (b) Write a C program which find the largest number from an array of 10 numbers. 3. Write a C program which read two matrices and find whether they can be multip lied or not. Also print sum of all the elements of the first matrix. Make necess ary assumptions. 4. Write a C program in which create a student structure to store students infor mation, such as :[Stu dent_Name,Student_Roll_No, Student_Program, Student_Sex, S tudent_Age] Also, make an array of this structure to store information of 10 stu dents. 5. write and run a program in C that has the following functions : (i) A function that takes input of an integer value between 1 and 5000. (ii) A function that reverses the digit of a given integer. Write the appropriate main ( ) that uses the function to take a valid integer in put, reverses the digits of the integer input and prints the original and revers ed numbers. 6. Write and run a program in C having the following functions : (i) A function to transpose a nxn matrix (ii) An input function that accepts input to a n x n matrix Write and run the appropriate main ( ) that uses the function to input a 3 x 3 m atrix, transposes it and prints the transposed matrix 7. Write and run a C program that has the following functions : (i) a function that reverses a string (ii) a function that finds the length of a string Write and run appropriate mait ( ) that accepts a string from the input, uses th e functions written by you to find the length of the input string, reverses it a nd then prints the lengttu original string and reversed string. 8. Write and run a program in C that has the following functions : (i) Afunctionthatreadsninputsintoan aftay.Thesizeof the affay mustbegreater than n. (ii) A function that searches the array f"or a value. Write and run the appropriate main ( ) functions that uses the functions as abov e to read an array of size 6 and then searches a value in the anay. The main ( ) outputs the aftay and the index at which the searched value is found. 9. write and run an interactiveC program to find a given number in an array of i nteger values. Also find the inex of the largest and smallest of the integer val ues in the array. Assume the array is of size 10. 10. Write and run a program in C that finds the top three rankers from the array of class marks.You may assume that the array index represents the student roll number. The class marks stored in the array are the total of the marks obtained by the students. 11. Write and run a program in C that adds two matrices of size n*n where n can be upto 5.Also write a function to print the diognal elements of matrices. 12. Write and run a C program that finds if the given number is prime. In case t he given number is prime, the program output it into the file named prime.txt. 13. Write and run a program in C having the following functions : (a).A function to input a string into an array. You may assume the maximum size of such string to be 10 characters. The string may be of any length upto 10 char acters. (b).A function that finds the characters at the middle of the string, for exampl e, if the string is 'ABC' then middle character is 'B' and if the string is 'ABC D' then the middle characters are BC. Write the appropriate main () function that demonstrates the use of the two func tions. Make and state suitable assumptions, if any. 14. Write and run a program in C having the following functions : (a).An input function that requests the user to enter two numbers in the range 1 to 1000. The function makes sure that the numbers entered by the user are in th

e given range. (b).A function that evaluates the Greatest Common Divisor (GCD) of the two numbe rs passed to this function. Write and run the appropriate main () that uses the two functions such that the GCD of the two input numbers is calculated and printed. 15. Write and run a C program having the following functions : (a).A function to convert lower case alphabtes in the string to upper case alpha bets.(Write your own function). (b).A function to count the number of vowels in the string. Write and run the appropriate main () that accepts the string from the input, us es the functions written by you and outputs the upper case string and the number of vowels 16. Write and run program in C that has the following functions : (a).An input function that allows input of a 3 x 3 matrix. (b).A function that adds two matrices. Write and run the appropriate main ( ) that uses the input function to input two distinct matrices, and uses the second function to add the matrices. The result ant matrix is then output. 17. write and run a program in C that has the following functions : (a). It has a function that read the specified number of integer values into an array. The maximum size of array may be assumed as 10. (b). A function that finds the maximum value and index on which this value is fo und in the afiay. (c). A function that finds the minimum value in the affay. (d). A main( )function that uses all the functions and then prints the array, ma ximum value and its index, and the minimum value. 18. Write and run a program in C having the following functions/features : (a). It has an aftay that stores a string. The maximum size of the string is of 20 charactersY. ou may take end of string charactera s '\0'. (b).It has a function "match_string" which matches the size of two strings given to it as parameters. You should use pointers for parameter passing. The match-s tring compares the size of the string, and refurns : 0 - if both the strings are of same size. 1 - if first string is of bigger size. 2 - if second string is bigger. (c).The main( ) function stores the strings and calls the match-string function and prints the bigger string. Make suitable assumptions, if any. 19. Write and run a program that has the following functions/features : (a).It has a recursive function to find the Greatest Common Divisor (GCD) of two numbers. (b).It has a main( ) program that accepts two integer values as input after chec king that these values are in the range 1 to 50. The main( ) function then calls the function that finds GCD and prints the GCD v alue. Make suitable assumptions, if any. 20. Write and run a program in C that reverses a string. The program also has a function that finds the location of first vowel in the string. Write and run app ropriate main ( ) that uses the function also 21. Write an interactive C program to generate a pay-slip for 7 employees in a s mall organisation whose Basic, TA, DA, Allowances, Perks, Deductions (like GPF, loans, LIC) are given by the user. The pay-slip should contain the name, scale o f pay, month and year, designation, department, gross-pay, net-pay and attendanc e. Note : Use "Structuresl' concept. 22. Write a program in C to concatenate two character strings and find the lengt h of the resultant string using Pointers. You are not allowed to use the string handling functions like strcat( ) and strlen( ) in C. 23. Write an interactive program in C to print the upper and lower triangle of t he matrix 24. Write an interactive program in C to direct the even and odd numbers to the respective files namely even.trrt and odd.txt, given a list of 10 numbers. Note: Use File-hsndling concepts

Assembly Language Programming 1. Write a 8086 assembly program which take a decimal number as input and find i ts binary equivalent number. 2. Write a program in 8086 assembly language that will take three decimal input and display smallest among them. 3. Write a 8086 assembly program which read a 4 digit decimal number and find th e sum of the digits. 4. Write and nm a program in 8086 assembly language that finds the maximum and m inimum of five given numbers. You may assume that these numbers are stored in co nsecutivem emory locations.T he resultant maximum and minimum numberss hould be stored in memory. Make suitable assumptions, if any. 5. Write and run a program in 8086 assembly language that finds the sum of the d igits of a packed 2-digit BCD number that is stored in a memory location. The re sult should be left in the AL register. 6. Write and run a program using 8086 assembly language that converts the lowerc ase alphabets in a string to uppercase alphabets. You may assume that the string is of 5 characters long and stored in the memory locations. You may also assume that string contains only alphabets that too in lowercase.The converted string is also to be stored in memory. 7. Write a program in 8086 assembly language that finds the sum of the values st ored in the memory. You may assume that 10 values are stored in consecutive memo ry location that are to be summed. The result may be left in AX register. 8. Write and run an assembly language program that finds the larger of the two g iven no. In case of both the no. being equal ,it returns the first of the two. 9. Write and run an assembly language program to convert 2 digit packed BCD no t o equivalent binary no. Assume that the BCD number is available in AL register 10. Write and run a program in Assembly language that converts a two digit ASCII number to equivalent binary. 11. Write and run an assembly language program that adds two single digit ASCII numbers. The result.should be in binary form. 12. Write and run a program in 8086 assembly language that sorts three numbers s tored in the consecutive memory locations in the ascending order. The sorted num bers should be stored into the memory. Make and state suitable assumptions, if a ny. 13. Write and run a program in 8086 assembly language that finds the sum of two unpacked single digit BCD numbers. You may assume that the numbers are stored in AL and AH registers. The resultant is converted to equivalent ASCII and stored in the memory. 14. Write and run a program using 8086 assembly language that squares each digit of a 2-digit packed BCD number, and then adds the two squares. You may assume t hat the two digit BCD number is stored in memory location. The result is left in the DX register. 15. Write a program in 8086 assembly language that counts the number of alphabet "a" in a given string. You may assume that the string is of 10 characters long and is stored in the memory. The result is left in the AL register. 16. Write a Program in 8086 assembly language that finds the factorial of the nu mber 6, that is stored in AL register. The result of the factorial should be lef t in AX register.

17. Write and run a program using 8086 assembly language that converts a string of length 6 of uppercase alphabets into lower case alphabets. You may assume the string is stored in the memory. The lowercase string is also stored in the memo ry but at a different location. 18. Write and run a program in 8086 assembly language that takes a packed 2 digi t BCD 20 number and displays the sum of squares of the digits. You may assume the number to be in AL register. (Example : Assuming AL contains 43 then the program should output 25 as : 4^2 + 3^2=16+9=25 ) 19. Write and run a program in 8086 assembly language that sorts five given numb ers in descending order. You may assume that these numbers are stored in memory Iocations. The sorted result should also be stored in the memory. Make suitable assumptions, if any 20. Write a program in assembly language to find the total and average of 5 deci mal numbers given by the user. 21. Write a program in assemblyl anguaget o convert a 4-digit BCD number to its binary equivalent 22. Write a program in assembly language to reverse a given string and also find its string length 23. Wiitn u program in assembly language to add h,vo 4-bit binary numbers.

Anda mungkin juga menyukai