ECE-C CSE102 - Computer Programming Assignment-1
ECE-C CSE102 - Computer Programming Assignment-1
1. Separate the even and odd numbers in an array of 20 elements into two
different arrays and give the count of elements present in each array.
2. Write a program to find out whether entered string is armstrong number or not
using function.
(eg) if input is 153 . so it is an armstrong number.
4. Write a program to display a given integer value in to binary value. (if input is
10 output is 1010)
5. In a company an employee is paid as given below.If his basic salary is less than
Rs.1500 then HRA=10% of basic salary and DA=25% of basic salary.If his
salary is either equal to or above Rs.1500 then HRA=Rs.500 and DA=50% of
basic.If the employee’s salary is input through the keyboard write a program to
find the gross salary which is the sum of basic salary and HRA and DA.
8. Write a program that reads 10 integers and prints the first and the last on one
line,the second and the ninth on the next line,the third and the seventh on the
next line, and so forth.
sample input: 0 1 2 3 4 5 6 7 8 9
ouput: 0 9
1 8
2 7
3 6
4 5
9. Write a program to read an amount from the user and count number of five
hundreds, hundreds, fifties ,twenties ,tens ,fives ,twos and ones.
sample input:2592
output: 5 - five hundreds
0 – hundreds
1 - fifties,0 - twenties
4 - tens ,0 - fives ,1 - twos ,0-ones
if input is 2592 then output is 5->500’s , 0->100, 1->50, 0->20’s, 4->10’s, 1-
>2.(5*500+0*100+1*50+0*20+4*10+1*2)
11.Write a program to print a number backward and check whether that number is
palindrome or not.
12.write a program to print the ascii value for the char that the user entered.
1. Write a program to calculate the following:
1!+2!+3!+……..+n!
14.Write a program to find out the roots of a quadratic equation by getting values
for a,b,c.
15.Write a program to find the sum of all integers between 100 to 200 which are
divisible by 8.
16. Write a program using switch case to display a day in a week. Declare
enumeration identifier as day and include days as values.
18. Write a program to get a value for x ,n and find x1+x2+x3+….+xn using
function.