0% found this document useful (0 votes)
34 views5 pages

Week 0.1 - Extra Assignment

Uploaded by

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

Week 0.1 - Extra Assignment

Uploaded by

rishabmunna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Week 0: Extra Assignments

1. Read the word “Crossroads” from the user and Print the word “Crossroads” Less
Than 8 times without using any loop or goto statement.

Code of the program & screenshot of the output.

2. Write a Program for pattern shown below


1
11
121
1231
12341
123451

Code of the program & screenshot of the output.

3. Write a program to compare two strings without using string functions.

Code of the program & screenshot of the output.

4. Write a menu driven program to perform following Operations without using Library
functions.
1. STRING LENGTH
2. STRING CONCATENATION
3. STRING REVERSE

A. The program should not end until the user exits the program by giving an
input to the program to exit. The menu Should contain an option to exit.
B. The program should Contain 4 Functions Excluding main():

a. STRINGLENGTH()
b. STRINGCONCATENATION()
c. STRINGREVERSE()
d. EXIT()

Code of the program & screenshot of the output.

5. Write a Program to copy one string to another without using String Functions?

Code of the program & screenshot of the output.

6. Read some Malayalam Movie Names from User And Sort it?

Code of the program & screenshot of the output.

7. Write a program to read the string “India is my country” from the user and find the
position of the word “is”?

Code of the program & screenshot of the output.

8. Read random numbers [ 22,87,178,34,10,45,22,89,31] from user and sort


numbers in descending Order?

Code of the program & screenshot of the output.

9. Read a character from the user and find the ASCII code of that character?

Code of the program & screenshot of the output.

10. Write a program to print the following pattern

A
ABA
ABCBA
ABCDCBA

Code of the program & screenshot of the output.

11. Read some numbers from the user and find the repeating numbers?
Eg:
Input :2 9 4 6 9 4
Output :9 4

Code of the program & screenshot of the output.

12. Read a line of text from the user , Find the number of Alphabets, Digits and
Special characters?

Eg,

Input : hello, Welcome to District B-13


Output :-
Number of Alphabets in the string is : 23
Number of Digits in the string is : 2
Number of Special characters in the string is : 7

Code of the program & screenshot of the output.

13. Read random numbers from the user, find the maximum number in the list of
numbers?
a. Use at least one function
b. The function should return a value to main function

Code of the program & screenshot of the output.

14. Read a random number (n) from the user and Generate nth Fibonacci
a. Must use Recursion

Code of the program & screenshot of the output.

15. Write a program to print following pattern

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

Code of the program & screenshot of the output.

16. It's your first day at school. Your teacher asked the students to meet every
other student in the class and to introduce themselves. The teacher asked
them to do handshakes when they meet each other.

If there are n number of students in the class then find the total number of
handshakes made by the students.
Program to find the maximum number of handshakes is discussed here.
Given a positive integer n, find out the total number of handshakes
possible.

Eg,
Input : 15 // Total Number of students
Output :105 //Maximum Number of Handshakes

Code of the program & screenshot of the output.

17. Read two numbers from the user and swap those two numbers using
Pointer.

Code of the program & screenshot of the output.

18. Convert the lowercase characters in a word into uppercase


Eg,
Input : Hello
Output : HELLO

Code of the program & screenshot of the output.


19. Write a program to calculate the charge for parcel:

If the weight of the parcel is less than 500gm or equal to 500gm then the
parcel charge will be Rs. 200, Otherwise there is an additional charge of
Rs.170 per each extra 500gm

Code of the program & screenshot of the output.

20. Write a program to perform the following calculation:


a. Matrix addition
b. Matrix multiplication
c. Matrix subtraction
d. Matrix transpose

● Program should be a menu driven program.


● Program should have Functions with arguments and Return Value.
○ List Functions:
■ matrix_addition()
■ matrix_multiplication()
■ matrix_subtraction()
■ matrix_transpose()
■ exit()
● Do not exit the program until the user enters the input to exit the
program.

Code of the program & screenshot of the output.

You might also like