Вы находитесь на странице: 1из 3

Assignment

Simple Statement
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. Input two numbers and calculate the sum to those number. Input three numbers. Calculate the sum and the average of those number. Input quantity in kilograms and convert it into grams. Input quantity in grams and convert it into K.G. Input rupees and convert them into paisa. Input paisa and convet them into rupees. calculate the area of a square calculate the area of a rectangle calculate area of a tringle calculate area of a circle calculate the square of given number. Swap the values of two variables.

If and If else 1. Input a number and print Good if the number is greater then 50. 2. Calculate the average of three number and print Good if the average is greater then 50 else print Bad. 3. Find the greater number between two number. 4. Check whether the given number is even or odd. Nested If and Logical If 1. Find the greatest number from three random number. 2. Calculate the average of five number and calculate the grade. The criteria for gradation is: a. If average>80 then grade is S b. If average is between 80 and 60 then grade is A. c. If average is between 60and 40 then grade is B. d. If average is < 40 the grade is F 3. Find the greatest number between four random number. (Without using looping) Looping 1. 2. 3. 4. 5. 6. 7. Print all the natural numbers from 1 to 10. Print all the natural numbers from 1 to n. Print all the natural numbers from n to 1. Print table of any given number. Calculate the factorial of any given number. Calculate the fabonachi series up to n terms. Calculate the sum of 10 random numbers.

8. 9. 10. 11. 12. 13. 14. 15.

Find the greatest number from 10 random numbers. Find the smallest number from 10 random numbers. Find the sum of all even numbers, and all odd numbers from 10 random numbers. Count the digits of any given number. Calculate the sum of all the digits of any given number. Check whether the given number is Armstrong or not. Convert a decimal number into binary number. Convert a binary number into decimal number.

Nested Looping 1. Calculate the factorial off all the natural numbers from 1 to 10 2. Calculate the factorial off all the natural numbers from 1 to n. 3. Print the table of all the natural numbers from 1 to n 4. Find out all the Armstrong numbers from 1 to n String. 1. 2. 3. 4. 5. 6. 7. 8. 9. Print a string character by character. Print a string in reverse order. Copy all the character of a string in another string. Copy all the character of a string in another string in reverse order. Find the frequency of any given character in any given string. Count the number of spaces and number of words. Find out whether the two strings are same of not. Count the frequency of any given words in any given string. Replace a word in a given string with another word of same length.

10. Array 1. 2. 3. 4. 5. Calculate the sum of all elements of an array Print an array in reverse order. Calculate the sum of all even numbers and all the odd numbers in an array. Calculate the sum of all number in even position and all numbers in odd positions. Replace all odd numbers of an array with the next higher number.

Double dimension Array 1. Sum of all elements. 2. Sum all rows 3. Sum of all columns. 4. Sum of both diagonals. 5. Mirror image of a D.D.Array. 6. Transpose a D.D.Array. 7. Reverse of an array 8. Sum of two arrays. 9. Multiplication of two arrays.

Вам также может понравиться