Documente Academic
Documente Profesional
Documente Cultură
1. Beginners
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. To display the message My first program on the screen. To display your name, and address on the computer screen. To input two numbers and find their sum. To input the values of Principal, Rate, and Time and calculate SI. To input a number and find its square and cube. To input the values of distance and speed and find the time taken to cover the given distance at the given speed. To input the values of radius and height of a cylinder and calculate its CSA and volume. To input the unit price of an item and the quantity of item to be bought. Then calculate the total price. To covert temperature from Fahrenheit to Celsius. WAP to enter the time in seconds and display it in format as: ____________ Seconds = _____ hr ________ min _______ seconds. To input two numbers and swap them using third variable. To input two numbers and swap them without using third variable.
#1/5
x
27.
x2 x3 ... 2 3
x2 x3 ... 2 3
x2 x3 ... 2! 3! x2 x3 ... 2! 3!
1 x
1 x
x3 x5 ... 3! 5!
#2/5
32.
33.
34.
35.
36.
37.
38.
#3/5
Arrays (1 Dimensional)
1. To input a list of 10 numbers and then display this list. 2. To input a list of 10 numbers and then display the list of all those numbers which are greater than the average of this list. 3. To input a list of numbers in an array and then rearrange this array in such a way that all the odd numbers appear in the beginning of the array and all the even numbers appear in the end of the array. E.g., if the input list is 1,4,2,7,6,5,9, then after rearrangement the list should be: 1,7,5,9,4,2,6. 4. To input a string and find the frequency of each alphabet appearing in the string. (Alphabet counting should not be case-sensitive) 5. To input a list of numbers and then reverse this list of numbers without using a second array. E.g. if the original list contains 5,2,3,4,1,9, then after reversal the list should contain 9,1,4,3,2,5.
#4/5
Arrays (2 Dimensional)
1. To input elements in a 2-D array and then display this array in matrix form. 2. To input the elements in a 2-D array and then find the sum of all the even elements of the array. 3. To find row-wise sum of a two-dimensional array. 4. To find column-wise sum of a two-dimensional array. 5. To find the sum of both left and right diagonal elements from a two-dimensional array. 6. To input elements in a 2 D array and print the sum of all the values which are either divisible by 3 or are divisible by 5 present in it. 7. To input an integer array and pass this array along with its size to a function which assigns the elements of 1-D array to a 2-D array in the following format: If the array is 1, 2, 3, 4, 5, 6 If the array is 1, 2, 3 The resultant 2-D array is: The resultant 2-D array is 123456 123 123450 120 123400 100 123000 120000 100000. 8. To input 10 strings and then for each string find out whether it is palindrome or not. 9. To input elements in two matrices and then find the sum of these matrices.
Structures
1. To input the co-ordinates of two points in a plane and find the distance between them. 2. To input a two rational numbers and find their sum, difference, and product. 3. To input two complex numbers and find their sum. 4. To input the name and aggregate marks of 10 students of a class and then display this marks list in the alphabetical order of the students names. 5. To input the co-ordinates of three vartices of a triangle and then find its area.
#5/5