0% found this document useful (0 votes)
43 views

C Programming Important Questions

The document provides examples of C programming exercises including printing patterns, checking voter eligibility, checking if a number is even or odd, printing numbers within a range excluding a given digit, calculating simple interest with different interest rates for senior citizens, performing matrix multiplication, and counting vowels in a string.

Uploaded by

Srimathi tj
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)
43 views

C Programming Important Questions

The document provides examples of C programming exercises including printing patterns, checking voter eligibility, checking if a number is even or odd, printing numbers within a range excluding a given digit, calculating simple interest with different interest rates for senior citizens, performing matrix multiplication, and counting vowels in a string.

Uploaded by

Srimathi tj
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
You are on page 1/ 2

CSA02 C Programming -Cycle-1

1. Write a program to print the below pattern.


Sample Input:
Number of line: 4
Sample output:
*
**
***
****
2. Compile and Execute the C program to find whether the person is eligible for vote or
not. And if that particular person is not eligible, then print how many years are left to
be eligible.
Sample Input:
Enter your age: 7
Sample output:
You are allowed to vote after 11 years
3. Compile and Execute the C program to check whether the number divisible by 2, then
print the given number even otherwise odd. Check and display the output on the
screen.
Sample Input:
Enter the number : 6561
Sample Output:
The given number is odd
4. Compile and Execute the C program to print numbers from P to Q but except
the digit R using continue statement. Check and display the output on the screen.
Sample Input:
P = 60
Q = 70
R=3

Sample Output:
Numbers are = 60, 61, 62, 64, 65, 66, 67, 68, 69, 70
5. Write a program using function to calculate the simple interest. Suppose the customer
is a senior citizen. He is being offered 12 percent rate of interest; for all other
customers, the ROI is 10 percent.
Sample Input:
Enter the principal amount: 200000
Enter the no of years: 3
Is customer senior citizen (y/n): n
Sample Output:
Interest: 60000
6. Write a program for matrix Multiplication?
Sample Input:
Mat1 = 1 2
5 3
Mat2 = 2 3
4 11
Sample Output:
Mat Mul = 10 25
22 48
7. Write a program to print the number of vowels in the given statement?
Sample Input:
Saveetha School of Engineering
Sample Output:
Number o vowels = 12

8. Write a program for matrix multiplication?


Sample Input:
Mat1 = 1 2
5 3
Mat2 = 2 3
4 1
Sample Output:
Mat Multiplication = 3 5
9 4

You might also like