You are on page 1of 4

C programming Questions:

1. C Program to Convert the given Binary Number into Decimal


2. C Program to Convert a Decimal Number to Binary & Count the Number of 1s
3. C Program to Convert a Given Number of Days in terms of Years, Weeks & Days
4. C Program to Reverse a Number & Check if it is a Palindrome
5. C Program to Find the Sum of two Binary Numbers
6. Use a function to Check whether a given Number is Armstrong
7. Use a function to Check whether a given Number is Perfect Number
8. Use a function to Print Armstrong Number from 1 to 1000
9. C Program to Swap the Contents of two Numbers using Bitwise XOR Operation

PRINT THE FOLLOWING PATTERNS:


10. A)
* *
* * * *
* * * * * *
* * * * * * * *
* * * * * * * * * *
* * * * * * * * * * * *
* * * * * * * * * * * * * *
* * * * * * * * * * * * * *
* * * * * * * * * * * *
* * * * * * * * * *
* * * * * * * *
* * * * * *
* * * *
* *

B)
* * * * * * * * * *
* * * * * * * *
* * * * * *
* * * *
* *

c)

* * * * *
* * * *
* * *
* *
*
*
* *
* * *
* * * *
* * * * *
D)

* * * * * * * * * *
* * * * * * * *
* * * * * *
* * * *
* *
* * * *
* * * * * *
* * * * * * * *
* * * * * * * * * *

E)

F)

G)
H)

11111
10001
10001
10001
11111

I)
55555
44445
33345
22345
12345
11.) Input an array of 10 elements. Find the sum of elements in even indices and odd
indices.
12.) Input a 2d square array. Find the sum and product of the main diagonal elements.
13.) For a given principle, rate of interest and number of years.
Find: a) Simple interest
b) Compound interest
14.) find the nearest cube root for a given number.
15.) find the nearest square root for a given number.
16.) Calculate Area and Volume of a Cone
17.) Program to Calculate nPr
18.) Calculate the Value of nCr
19.) Volume and Surface Area of a Sphere
20.) Input an array of characters and sort them alphabetically
21.) Input a 2d matrix and find its:
a) Sum of all elements
b) Sum of even row elements
c) Transpose of matrix
d) Determinant of matrix
e) Find inverse if it exists

22) Input two 1-d arrays and find their: a) union b)intersection

23) print hello world without using semicolon

24) print the following series:

A) (1*1) + (2*2) + (3*3) + (4*4) + (5*5) + ... + (n*n)


B) (1) + (1+2) + (1+2+3) + (1+2+3+4) + ... + (1+2+3+4+...+n)
C) 1! + 2! + 3! + 4! + 5! + ... + n!
D) (1^1) + (2^2) + (3^3) + (4^4) + (5^5) + ... + (n^n)
E) (1!/1) + (2!/2) + (3!/3) + (4!/4) + (5!/5) + ... + (n!/n)
F) [(1^1)/1] + [(2^2)/2] + [(3^3)/3] + [(4^4)/4] + [(5^5)/5] + ... + [(n^n)/n]
G) [(1^1)/1!] + [(2^2)/2!] + [(3^3)/3!] + [(4^4)/4!] + [(5^5)/5!] + ... + [(n^n)/n!]
H) 1 2 3 6 9 18 27 54...

25) Find sum of all non-prime numbers from 1 to 100 (Use ‘continue’ statement)

26.) Find the sum of non- cube numbers from 1 to 100

27) Find of agiven number is a STRONG NUMBER.

Strong number is a number whose sum of all digits’ factorial is equal to the number ‘n’. So,
to find a number whether its strong number, we have to pick every digit of the number like
the number is 145 then we have to pick 1, 4 and 5 now we will find factorial of each number
i.e, 1! = 1, 4! = 24, 5! = 120.

Now we will sum up 1 + 24 + 120 so we get 145, that is exactly same as the input given, So
we can say that the number 145 is strong number.
28) Input a 1-d array and find the mean, median and mode
29) Input a array of distinct elements and Cyclically Permute the Elements of an
Array
30) C Program to Find the Odd Element given an Array with only two Different
Elements. Input the 2 allowed elements from user.

You might also like