0% found this document useful (0 votes)
15 views18 pages

Swarna Mam Lab Report

cse1122

Uploaded by

habibur.dreamer
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)
15 views18 pages

Swarna Mam Lab Report

cse1122

Uploaded by

habibur.dreamer
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/ 18

INDEX

Title Title name Page


number number

Title-1 Armstrong Number 02

Title-2 1D Array 03

Title-3 Summation of array elements 06

Title-4 Pattern 07

Title-5 Piramid Pattern 10

Title-6 Primid Pattern for birthday 11

Title-7 Access Array Elements Using Pointers 12

Title-8 Sting manipulation without library 13


functio
Title-9 STRUCT 14

Title-10 Using file read, write 17

Title-11 String operations 18

1
Title-01: Armstrong Number
Problem description: Write a C program to find out if a given
number is a "Armstrong Number".

Code:

Output:

2
Title-02: 1D Array
Problem description:
• Take two 1-D float array A[5], B[5] as input with size 5.
• Again take five 1-D arrays

sum[5], sub[5], mul[5], div[5], mod[5] as input with size 5.


• Now do the following operations and store the values in sum[5], sub[5], mul[5], div[5],
mod[5] respectively

1. Summation
2. Subtraction
3. Multiplication
4. Division
5. Modulo

Code:

3
4
Output:

5
Title -03: Summation of array elements.

Problem description: Add last two digits of your roll in each variable you
have used in the code.

Code:

6
Output:

Title-04: Pattern

Problem description:
Print Series
a.

1+2+3+4+.......................+11
b.

1++3+5+.......................+11
c.
2+4+.......................+11
d.

1+2/3+4/5+6/7....................../11+

5. print pattern:
*
**

7
***
****
*****

Code: Output:

Code: Output:

8
Code: Output:

Code: Output:

Title-05: Piramid Pattern

Problem description:
Print pattern
1
212

9
32123
4321234
543212345

Code:

Output:

Title-06: Primid Pattern for birthday


Problem description:
Print the folowing pattern
h

10
ap
pyb
irth
day110

Code:

Output:

Title-07: Access Array Elements Using Pointers

Problem description:

11
C Program to Access Array Elements Using Pointer
To understand this example, you should have the knowledge of the following C
programming topics:
• C for Loop
• C Arrays
• C Pointers
• Relationship Between Arrays and Pointers

Code: Output:

Title-08: Sting manipulation without library function


Problem description:
Write a program in C to extract a substring from a given string.
Sample Input Output: Extract a substring from a given string:

12
--------------------------------------------
Input the string : This is test string
Input the position to start extraction :9
Input the length of substring :4
The substring retrieve from the string is : " test "
Code:

Output:

13
Title-09: STRUCT
Problem description:
take 5 student's information as input and calculate their GPA using STRUCT
Number of students: 2
number of subject: 2
enter information of student1:
name: A
roll: 1
mark:
subject1: 100
subject2: 90

enter information of student2:


name: A
roll: 2
mark:
subject1: 90
subject2: 90

output:
A+
A+

14
Code:

15
Output:

16
Title-10: Using file read, write
Problem description:
Create a program that reads data from a text file (input.txt), processes the data, and
writes the processed data to another text file (output.txt).
Code:

17
Output:

Title-11: String operations


Problem description:
Perform following operations without using built in string function:
1. reversed string
2. string length
3. vowels
4. consonants

Code:

Output:

18

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy