C Programming 1
C Programming 1
C Programming
Aniket Singh
Rayat-Bahra University, Chandigarh
Questions
Experiment 1 Write a program to print "Hello World" on the screen.
Experiment 2 Write a program to add two numbers. The numbers should be provided by the user
as input.
Experiment 3 Write a program to increment and decrement any variable using the unary operator.
Experiment 7 Write a program to find the largest among three numbers using the ternary operator.
Experiment 9 Write a program to calculate the sum of n numbers provided by the user.
Experiment 13 Write a program to implement a rating system using the switch statement.
Experiment 15 Write a function to print the following pattern for a given value of n (e.g., n = 5):
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1
Experiment 16 Write a function to print a hollow rectangle pattern.
* * * * *
* * * * *
* * * * *
* * * * *
* * * * *
* * * * *
* *
* *
* *
* * * * *
1
0 1
0 1 0
1 0 1 0
1 0 1 0 1
Experiment 25 Write a program to find the sum of first and last digit of a given number.
Experiment 27 Write down the program to count odd and even numbers in given array.