0% found this document useful (0 votes)
25 views10 pages

C Programming Questions on Digit Manipulation

The document contains a series of programming questions focused on digit manipulation and conditional operations in C programming, categorized into levels 6 to 8. Each question provides a specific task, such as calculating sums, determining prime numbers, and counting digits, along with examples of input and expected output. The questions aim to enhance the understanding and application of basic programming concepts related to numbers and their properties.

Uploaded by

Sneha.j Sneha.j
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views10 pages

C Programming Questions on Digit Manipulation

The document contains a series of programming questions focused on digit manipulation and conditional operations in C programming, categorized into levels 6 to 8. Each question provides a specific task, such as calculating sums, determining prime numbers, and counting digits, along with examples of input and expected output. The questions aim to enhance the understanding and application of basic programming concepts related to numbers and their properties.

Uploaded by

Sneha.j Sneha.j
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

C_Programming_Level_6-8

[Link] Level Category Question Text


Question31:
Get a three-digit number from user. If the sum of the digits is less than 10, then print the
sum, otherwise add the digits of the sum. If the sum of the digits is less than 10, then print
the sum, otherwise add the digits of the sum, and print the sum.
Conditional
Note: The result should be always single digit only.
1 6 Operations with Digit
Manipulation
Example:1
Input :123 (1+2+3) Output :6.
Example:2
Input:149 (1+4+9=14, 1+4) Output:5.

Question32:
Get two 2-digit numbers from user. If the sum of the numbers is less than 100, then print
Conditional the sum, otherwise print the difference.
2 6 Operations with Digit
Manipulation Example:1
Input :56 78 Output :22.
Example:2
Input:14 65 Output:79.
Question33:
Get two 2-digit numbers from user. Print the sum of digits of the biggest number.
Conditional
3 6 Operations with Digit
Example:1
Manipulation
Input :56 78 Output :15.
Example:2
Input :14 65 Output:11.
Question34:
Get two 3-digit numbers from user. Print the difference between the one’s digit and
hundred’s digit of the number whose ten’s digit is bigger than the other number’s ten’s
Conditional digit.
4 6 Operations with Digit
Manipulation Example:1
Input :856 978 Output :1.
Example:2
Input :954 622 Output :5.

Question35:
Get two 3-digit numbers from user. Add the one’s and hundred’s digits of both the
numbers. Print the sum of all the digits of the number whose sum of one’s and hundred’s
Conditional digits is bigger
5 6 Operations with Digit
Manipulation Example:1
Input :856 978 Output :24.
Example:2
Input :128 365 Output :11
Question36:
Write a program to get a number from user print the total number of digits in that
number

Number Series with Example 1:


6 7
Digit Manipulation Input : 123456 Output 6
Example 2:
Input : 76895439 Output 8
Example 3:
Input : 675 Output 3

Question37:
Write a program to get a number from user and print the sum of all digits.

Number Series with Example 1:


7 7
Digit Manipulation Input: 123456 Output 21
Example 2:
Input: 76895439 Output 51
Example 3:
Input: 675 Output 18
Question38:
Write a program to get a number from user and print the reverse of that number.
Number Series with
8 7
Digit Manipulation Example: 1
Input : 123456 Output 654321
Input : 76895439 Output 93459867
Input : 675 Output 576

Question39:
Write a program to get a number from user and interchange the first and last digits and
Number Series with print the result.
9 7
Digit Manipulation
Example:
4

Question40:
Write a program to get a number from user and if the last digit of the number is even
print the same number. If the last digit of the number is
Number Series with
10 7 odd then subtract 1 from the last digit and print the number. (Note: Last digit -MSB)
Digit Manipulation
Example: 1
Input : 123456 Output 123456
Input : 96895439 Output 86895439
Input : 675 Output 575
Question41:
Write a program get number from user print whether that number is prime or not.
Number Series with
11 7
Digit Manipulation Example: 1
Input : 31 Output : Prime
Example: 2
Input : 27 Output : Not Prime.

Question42:
Write a program to get a number from user, print whether that number is prime, and sum
of digit is equal to 14.
Number Series with
12 7
Digit Manipulation Example: 1
Input: 59 Output: Prime & Sum of Digits is 14
Example : 2
Input: 77 Output: Not Prime but sum of digits is 14
Example : 3
Input : 13 - Output: Prime, but sum of Digits is not 14
Question43:
Write a program to get number from user, print whether that number’s first two digits
(ten’s digits and one’s digit) is prime.
Number Series with
13 7
Digit Manipulation
Example 1
Input: 359 Output: Prime
Example 2
Input: 3577 Output: Not Prime

Question44:
Write a program to get a 4-digit number from user, print whether that
number’s middle two digits (hundred’s digit and ten’s digit) is prime.
Number Series with
14 7
Digit Manipulation Example: 1
Input :6359 Output: Not Prime.
Example: 2
Input:3517 Output: Prime.
Question45:
Write a program get number from user print the total number digits which are odd in the
number.
Number Series with
15 7
Digit Manipulation
Example: 1
Input :12345678 Output 4.
Example: 2
Input:987531 Output 5.

Question46:
Write a program get number from user print the total number of two-digit odd numbers
in the number.
Number Series with
16 7
Digit Manipulation Example: 1
Input : 1234567 Output 3.
Example: 2
Input: 987531 Output: 4
Question47:
Write a program get number from user print the total number of single-digit perfect
square numbers in the number.
Number Series with
17 8
Digit Manipulation
Example: 1
Input :123456789 Output 3.
Example: 2
Input:987531 Output: 2.

Question48:
Write a program get number from user print the total number of two-digit perfect square
numbers in the number.
Number Series with
18 8
Digit Manipulation Example: 1
Input : 163496481 Output 4.
Example: 2
Input:364925 Output 4.
Question49:
Write a program get number from user print the total number of single-digit prime
numbers in the number.
Number Series with
19 8
Digit Manipulation
Example: 1
Input :163496481 Output 1.
Example: 2
Input:364925 Output 3

Question50:
Number Series with Write a program to print biggest 4-digit number which is divisible by 7 and 9.
20 8
Digit Manipulation

Example:
Input 9999 Output 9954.
Question51:
Write a program to get two numbers from user and print the LCM of those numbers.
Number Series with
21 8 Example: 1
Digit Manipulation
Input :234 457 Output 106938.
Example: 2
Input:123 456 Output 18696
Question52:
Write a program to get three numbers from user and print the LCM of those numbers.

Example: 1
Input :
12
13
Number Series with
22 8 45
Digit Manipulation
Output 2340.
Example: 2
Input:
45
89
90
Output 8010

Question53:
Number Series with Write a program to get two numbers from user and print the HCF of those numbers.
23 8
Digit Manipulation
Example: 1
Input :23 45 Output 1.
Example: 2
Input:345 87 Output 3.

You might also like