C Assignment

Assignment-1 | printf () Statement

1. Develop C code to print “Your Name” and “Surname”  
2. Develop C code to clear the output screen and print “Welcome”.  
3. Develop C code to print “Hello World”, allow user to see output.  
4. Develop C Code to print the following in the center of screen.  


                     *********************  
                     |                |  
                     |     I am Star  |  
                     |                |  
                     *********************  

5. Develop C code to print your biodata.  
6. Develop C code that prints your name at the bottom-right line of the screen. 
7. Develop C code that demonstrates single & multiline comments.

Assignment-2 | scanf () Statement

(1) Enter the value of an integer variable and prints it on screen.
(2) Input a number, print its multiplication table up to 10.
(3) Input two numbers and prints its square and cube.
(4) Input two numbers and prints its Addition, Substraction, Multiplication,
     and Division.
(5) Verify the formula of Simple Interest.
(6) Input a Rupees and prints its value converted into Dollar.
(7) Input a Number of Chairs and its Total Cost and Prints the Cost of Each 
     chair.
(8) Verify the formula   l = (c+d)*(g+h).
(9) Verify the formula x = ((k-4)*(a*4))/100
(10) verify the formula s = ((4*a+c)-2*a*b)/100
(11) verify the formula  a = p*(1+(r/100)/n)-p
(12) Verify the formula t = ((v+s)+(l-m)*l)
(13) Calculate the area of circle.
(14) Calculate the area of Triangle.
(15) Verify the formula c = (a+b)*(a+b)

Assignment-3 | if else Statement

(1) Input 1 number, check whether it is less, equal or greater than zero.  
(2) Input 2 number and print the maximum among them.  
(3) Input 2 numbers and print the maximum among them.(without If statement)  
(4) Input 2 numbers and print the minimum among them.  
(5) Input 2 number and print the minimum among them. (without If statement)  
(6) Input 3 numbers and print the maximum among them.  
(7) Input the age of 5 students and print the number of students with an age less than or equal to 21 and greater than 21.  
(8) Input 3 subject marks, calculate total, average and grade.  
(9) Write a program to perform the arithmetic operation of two numbers. Allow the user to decide the arithmetic operation at runtime.
(10) Input a number & print whether the number is odd or even.  
(11) Input a character in lower case, and display it in upper case.  
(12) Input a character, print whether the character is a vowel or consonant.     
(13) Input 1 number (day number of week), print day name of given day number.  
(14) Write the above program using the switch case statement.  
(15) Input 1 number (month number of the year); print the month name of given month number.  
(16) Write above program using switch case statement.

Assignment-4 | Looping Structure (while, do…while, for)

(1) print 1 to 10
(2) print 2,4,6,8,10
(3) print 1,3,5,7,9.
(4) print 1,2,4,8,16,32,64
(5) print 10 to 1
(6) print 1,10,2,9,3,8,4,7,5,6
(7) print 2,11,20,28,25,41,46,50,53,55,56
(8) print first 100 even number.
(9) print first 100 odd number.
(10) print first 50 natural number.
(11) print the total of 1 to 50.
(12) print the total of 1/2+2/3+….+9/10.
(13) print the total of 1-2+3-4+5-6+7-8+9-10.
(14) print the total of first 100 even numbers.
(15) print the total of first 100 odd numbers.
(16) 0.1+0.02+0.003+0.0004+0.000005.
(17) Accept one number from user and display Reverse of it.
(18) Accept one number from user and display sum of its digits.
(19) Accept one number from user and display its factorial.
(20) Accept one number from user and find if it is prime or not.
(21) Accept one number from user and find if it is Armstrong or not.
(22) Print 0 1 1 2 3 5 8 13 21 34 55 … up to n (Fibonacci series)

Assignment-5 | Nested Looping Structure

Pattern-IPattern-IIPattern-III
*
**
***
****
*****
*
**
***
****
*****
*
**
***
****
*****
12345
12345 
12345
12345
12345
11111
22222
33333
44444
55555
1  2  3   4   5
2  4  6   8   10
3  6  9   12 15
4  8  12 16  20
5  1015  20 25
A A A A A
B B B  B B
C C C C C
D D D D D
E  E E  E E
1
22
333
44444
555555
1
12
123
1234
12345
5
54
543
5432
54321
1
21
321
4321
54321
1
2  3
4  5  6
7  8  9  10
1112131415
1
01
010
1010
10101
1
10
101
1010
10101
a
b c
d e f
g h i j
k l m n o
A
bb
ccc
dddd
eeeee
z
y  x
w v u
t   s  r q
p  o n m l
1
10
100
1000
10000
5
45
345
2345
12345
Implement all above program with Pattern-II & Pattern-III
12345
1234
123
12
1
12345
2468
369
48
5
54321
5432
543
54
5
54321
4321
321
21
1
12345
2345
345
45
5
55555
4444
333
22
1
2 4 6 8 10
4 6 8 10
6 8 10
8 10
10
a b c d e
b c d e
c d e
d e
e
Implement all above program with Pattern-I & Pattern-II