0% found this document useful (0 votes)
5 views50 pages

lab.pdf

The document contains a series of C programming exercises that demonstrate various operations on arrays and matrices, including finding sums, maximum and minimum elements, sorting, searching, and matrix operations like addition and transposition. Each exercise is accompanied by code snippets and expected outputs. The programs cover fundamental concepts such as loops, conditionals, and functions in C.

Uploaded by

godoc1414
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)
5 views50 pages

lab.pdf

The document contains a series of C programming exercises that demonstrate various operations on arrays and matrices, including finding sums, maximum and minimum elements, sorting, searching, and matrix operations like addition and transposition. Each exercise is accompanied by code snippets and expected outputs. The programs cover fundamental concepts such as loops, conditionals, and functions in C.

Uploaded by

godoc1414
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/ 50

Q1 Write a C program to find sum of all array

elements.
Code 

#include <stdio.h>

int main() {

int arr[5] = {10, 20, 30, 40, 50}; int sum

= 0; int i; for(i = 0; i < 5; i++) {

sum = sum + arr[i];

printf("Total sum: %d\n", sum);

return 0;

Output 

Q2 Write a C program to print all negative elements in


an array.

Code 

#include <stdio.h>

int main() {
int arr[6] = {10, -5, 20, -15, 30, -25};

int i;

printf("Negative numbers in the array:\n");

for(i = 0; i < 6; i++) {

if(arr[i] < 0) {
printf("%d\n", arr[i]); }
}

return 0;

Output 

Q3 Write a C program to find maximum element in an array.


Code 

#include <stdio.h>

int main() {

int arr[5] = {10, 50, 30, 70, 20};

int i, max;

max = arr[0];

for(i = 1; i < 5; i++) {

if(arr[i] > max) {

max = arr[i];

printf("Maximum element: %d\n", max);

return 0;

}
Output

Q4 Write a C program to find minimum element in an array.

Code 

#include <stdio.h>

int main() {

int arr[5] = {10, 50, 30, 5, 20};

int i, min;

min = arr[0];

for(i = 1; i < 5; i++) {

if(arr[i] < min) {

min = arr[i];

printf("Minimum element: %d\n", min);

return 0;

Output 

Q5 C program to find second largest element in an array.


Code  #include <stdio.h>

int main() {

int arr[5] = {10, 50, 30, 70, 20};

int i, max, second_max;

max = arr[0];

second_max = arr[0];

for(i = 1; i < 5; i++) {

if(arr[i] > max) {

second_max = max;

max = arr[i];

else if(arr[i] > second_max && arr[i] != max) {

second_max = arr[i];

printf("Second largest element: %d\n", second_max);

return 0;

Output
Q6 Write a C program to count total number of even and odd elements in an
array.
Code 

#include <stdio.h>

int main() {

int arr[6] = {10, 15, 20, 25, 30, 35};

int i, even_count = 0, odd_count = 0;

for(i = 0; i < 6; i++) {

if(arr[i] % 2 == 0) {

even_count++;

else {

odd_count++;

printf("Total even numbers: %d\n", even_count);

printf("Total odd numbers: %d\n", odd_count);

return 0;

Output

Q7 Write a C program to copy all elements from an array to another array.

Code 

#include <stdio.h>

int main() {

int arr1[5] = {10, 20, 30, 40, 50};


int arr2[5];

int i;

for(i = 0; i < 5; i++) {

arr2[i] = arr1[i];

printf("Elements of second array:\n");

for(i = 0; i < 5; i++) {

printf("%d ", arr2[i]);

return 0;

Output

Q8 Write a C program to delete an element from an array at specified


position
Code 

#include <stdio.h>

int main() {

int arr[5] = {10, 20, 30, 40, 50};

int pos = 2;

int i;

for(i = pos; i < 4; i++) {

arr[i] = arr[i + 1];

printf("Array after deletion:\n");

for(i = 0; i < 4; i++) {


printf("%d ", arr[i]);

return 0;

Output

Q9 C Program to Search an Element in an Array (linear search)

Code 

#include <stdio.h>

int main() {

int arr[3] = {5, 10, 15};

int key = 10;

int i;

for(i = 0; i < 3; i++) {

if(arr[i] == key) {

printf("Element found at index %d\n", i);

return 0;

printf("Element not found\n");

return 0;

Output
Q10 C Program to Search an Element in an Array (Binary search)

Code 

#include <stdio.h>

int main() {

int arr[3] = {10, 20, 30};

int key = 20;

int low = 0, high = 2, mid;

while(low <= high) {

mid = (low + high) / 2;

if(arr[mid] == key) {

printf("Element found at index %d\n", mid);

return 0;

else if(arr[mid] < key) {

low = mid + 1;

else {

high = mid - 1;

printf("Element not found\n");

return 0;

}
Output

Q11 C Program to Sort an Array using Bubble Sort and Merge Sort

Code 

1.Bubble Sort

#include <stdio.h>

int main() {

int arr[3] = {30, 10, 20};

int i, j, temp;

for(i = 0; i < 2; i++) {

for(j = 0; j < 2 - i; j++) {

if(arr[j] > arr[j+1]) {

temp = arr[j];

arr[j] = arr[j+1];

arr[j+1] = temp;

printf("Sorted Array:\n");

for(i = 0; i < 3; i++) {

printf("%d ", arr[i]);

}
return 0;

2.Merge Sort

#include <stdio.h>

void merge(int arr[], int l, int m, int r) {

int i, j, k;

int n1 = m - l + 1;

int n2 = r - m;

int L[n1], R[n2]; // Temporary arrays

for(i = 0; i < n1; i++)

L[i] = arr[l + i];

for(j = 0; j < n2; j++)

R[j] = arr[m + 1 + j];

i = 0, j = 0, k = l;

while(i < n1 && j < n2) {

if(L[i] <= R[j]) {

arr[k] = L[i];

i++;

} else {

arr[k] = R[j];

j++;

k++;

while(i < n1) {

arr[k] = L[i];

i++;

k++;

}
while(j < n2) {

arr[k] = R[j]; j++;

k++;

void mergeSort(int arr[], int l, int r) {

if(l < r) {

int m = l + (r - l) / 2;

mergeSort(arr, l, m);

mergeSort(arr, m + 1, r);

merge(arr, l, m, r);

int main() {

int arr[5] = {50, 10, 40, 20, 30};

int i;

mergeSort(arr, 0, 4);

printf("Sorted Array (Merge Sort):\n");

for(i = 0; i < 5; i++) {

printf("%d ", arr[i]);

return 0;

OutPut
1.

2.

Q12 C Program to Sort an Array Using Selection Sort and Array Using
Insertion Sort.
Code 

1. Selection Sort
#include <stdio.h>

void selectionSort(int arr[], int n) {


int i, j, minIndex, temp;

for (i = 0; i < n - 1; i++) {


minIndex = i;
for (j = i + 1; j < n; j++) {
if (arr[j] < arr[minIndex])
minIndex = j;
}
temp = arr[i];
arr[i] = arr[minIndex];
arr[minIndex] = temp;
}
}

int main() {
int arr[5] = {50, 10, 40, 20, 30};
int i;

selectionSort(arr, 5);

printf("Sorted Array (Selection Sort):\n");


for (i = 0; i < 5; i++) {
printf("%d ", arr[i]);
}

return 0;
}
2. Insertion Sort
#include <stdio.h>

void insertionSort(int arr[], int n) {


int i, j, key;

for (i = 1; i < n; i++) {


key = arr[i];
j = i - 1;

while (j >= 0 && arr[j] > key) {


arr[j + 1] = arr[j];
j--;
}
arr[j + 1] = key;
}
}

int main() {
int arr[5] = {50, 10, 40, 20, 30}; // only 5 elements
int i;

insertionSort(arr, 5);

printf("Sorted Array (Insertion Sort):\n");


for (i = 0; i < 5; i++) {
printf("%d ", arr[i]);
}

return 0;
}

Output

1.Selection Sort
2.Insertion Sort

Q13 C Program to Sort the Elements of an Array in Descending Order

Code

#include <stdio.h>

int main() {

int arr[3] = {30, 10, 20}; // only 3 elements

int i, j, temp;

for (i = 0; i < 2; i++) { // for 2 rounds

for (j = 0; j < 2 - i; j++) {

if (arr[j] < arr[j + 1]) { // Swap for descending order

temp = arr[j];

arr[j] = arr[j + 1];

arr[j + 1] = temp;

printf("Sorted Array (Descending Order):\n");

for (i = 0; i < 3; i++) {

printf("%d ", arr[i]);

return 0;
}

Output

Q14 C Program to Merge Two Arrays

Code

#include <stdio.h>

int main() {

int arr1[3] = {10, 20, 30};

int arr2[3] = {40, 50, 60};

int merged[6];

int i;

for (i = 0; i < 3; i++) {

merged[i] = arr1[i];

for (i = 0; i < 3; i++) {

merged[i + 3] = arr2[i];

// Merged array

printf("Merged Array:\n");

for (i = 0; i < 6; i++) {

printf("%d ", merged[i]);

}
return 0;

Output

Q15 C Program to count the number of occurrences of an Element in an Array

Code

#include <stdio.h>

int main() {

int arr[5] = {10, 20, 10, 30, 10};

int search = 10;

int i, count = 0;

for (i = 0; i < 5; i++) {

if (arr[i] == search) {

count++;

printf("Element %d occurs %d times in the array.\n", search, count);

return 0;

Output
Q16 C Program to Find the Transpose of a matrix and Trace of a matrix

Code 

#include <stdio.h>

int main() {

int matrix[3][3] = { {1, 2, 3},

{4, 5, 6},

{7, 8, 9} };

int transpose[3][3]; // Transpose matrix

int i, j, trace = 0;

for (i = 0; i < 3; i++) {

for (j = 0; j < 3; j++) {

transpose[j][i] = matrix[i][j];

for (i = 0; i < 3; i++) {

trace += matrix[i][i];

// Matrix print

printf("Original Matrix:\n");

for (i = 0; i < 3; i++) {

for (j = 0; j < 3; j++) {

printf("%d ", matrix[i][j]);


}

printf("\n");

// Transpose print

printf("\nTranspose of Matrix:\n");

for (i = 0; i < 3; i++) {

for (j = 0; j < 3; j++) {

printf("%d ", transpose[i][j]);

printf("\n");

// Trace print

printf("\nTrace of Matrix: %d\n", trace);

return 0;

Output
Q17 C Program to check if two matrices are equals or not

Code 

#include <stdio.h>

int main() {

int matrix1[2][2] = { {1, 2},

{3, 4} }; // first 2x2 matrix

int matrix2[2][2] = { {1, 2},

{3, 4} }; //second 2x2 matrix

int i, j, flag = 1; // flag 1 → Assume equal

// Compare karenge elements ko

for (i = 0; i < 2; i++) {

for (j = 0; j < 2; j++) {

if (matrix1[i][j] != matrix2[i][j]) {

flag = 0;

break;

// Result print

if (flag == 1)

printf("Matrices are equal.\n");

else

printf("Matrices are NOT equal.\n");

return 0;

Output
Q18C program to check symmetric matrix

Code 

#include <stdio.h>

int main() {

int matrix[2][2] = { {1, 2},

{2, 1} };

int i, j, flag = 1;

// Check karenge (Transpose = Original?)

for (i = 0; i < 2; i++) {

for (j = 0; j < 2; j++) {

if (matrix[i][j] != matrix[j][i]) {

flag = 0;

break;

// Result print

if (flag == 1)

printf("Matrix is Symmetric.\n");

else

printf("Matrix is NOT Symmetric.\n");


return 0;

OutPut

Q19 C Program to Add Two Matrices

Code 

#include <stdio.h>

int main() {

int matrix1[2][2] = { {1, 2},

{3, 4} }; // Pehla 2x2 matrix

int matrix2[2][2] = { {5, 6},

{7, 8} };

int sum[2][2];

int i, j;

for (i = 0; i < 2; i++) {

for (j = 0; j < 2; j++) {

sum[i][j] = matrix1[i][j] + matrix2[i][j];

}
}

// Result print
printf("Sum of the Matrices:\n");

for (i = 0; i < 2; i++) {

for (j = 0; j < 2; j++) {

printf("%d ", sum[i][j]);

printf("\n");

return 0;

Output 

Q20 C Program to Multiply Two Matrices

Code 

#include <stdio.h>

int main() {

int matrix1[2][2] = { {1, 2},

{3, 4} };

int matrix2[2][2] = { {5, 6},

{7, 8} };

int result[2][2]; // Resultant matrix

int i, j, k;

// Multiplication logic
for (i = 0; i < 2; i++) {

for (j = 0; j < 2; j++) {

result[i][j] = 0;

for (k = 0; k < 2; k++) {

result[i][j] += matrix1[i][k] * matrix2[k][j]; //


Multiplication & sum

// Result print

printf("Product of the Matrices:\n");

for (i = 0; i < 2; i++) {

for (j = 0; j < 2; j++) {

printf("%d ", result[i][j]);

printf("\n");

return 0;

Output

Q21C program to find the length of a string without using library function

Code 

#include <stdio.h>
int main() {

char str[] = "Hello";

int i = 0, length = 0;

while (str[i] != '\0') {

length++;

i++;

// Result print

printf("Length of the string: %d\n", length);

return 0;

Output

Q22C Program to Add or Concatenate Two Strings without using library


function

Code 
#include <stdio.h>

int main() {

char str1[100] = "Hello ";


char str2[] = "World!";

int i = 0, j = 0;

while (str1[i] != '\0') {

i++;

while (str2[j] != '\0') {

str1[i] = str2[j];

i++;

j++;

str1[i] = '\0';

// Result print

printf("Concatenated String: %s\n", str1);

return 0;

OutPut

Q23 C Program to count the occurrence of a character in a given String


Code 

#include <stdio.h>

int main() {

char str[100], ch;

int i = 0, count = 0;

// User se string lena

printf("Enter a string: ");

fgets(str, 100, stdin);

// Taking input

printf("Enter the character to count: ");

scanf("%c", &ch);

while (str[i] != '\0') {

if (str[i] == ch) {

count++;

i++;

// Result print

printf("Character '%c' occurs %d times in the string.\n", ch, count);

return 0;

Output
Q24 C Program to check if the string is palindrome or not

Code 

#include <stdio.h>

#include <string.h>

int main() {

char str[100];

int i, length, isPalindrome = 1;

printf("Enter a string: ");

fgets(str, 100, stdin); // Safe input method

length = strlen(str);

if (str[length - 1] == '\n') {

str[length - 1] = '\0';

length--;

for (i = 0; i < length / 2; i++) {

if (str[i] != str[length - i - 1]) {

isPalindrome = 0; // Not palindrome

break;

}
}

// Result print

if (isPalindrome)

printf("The string is a palindrome.\n");

else

printf("The string is NOT a palindrome.\n");

return 0;

Output

Q25 C Program to Reverse a String with and without using library function

Code 

1.By using library function

#include <stdio.h>

#include <string.h>

int main() {

char str[100];

printf("Enter a string: ");

fgets(str, 100, stdin);

str[strcspn(str, "\n")] = 0;
strrev(str);

printf("Reversed String: %s\n", str);

return 0;

2. Without using library function

#include <stdio.h>

#include <string.h>

int main() {

char str[100], rev[100];

int i, length;

printf("Enter a string: ");

fgets(str, 100, stdin);

length = strlen(str);

if (str[length - 1] == '\n') {

str[length - 1] = '\0';

length--; // Length adjust

// Reverse manually

for (i = 0; i < length; i++) {

rev[i] = str[length - i - 1];

rev[length] = '\0';

printf("Reversed String: %s\n", rev);

return 0;

Output
Q26C Program to count the number of vowels present in the sentence

Code 

#include <stdio.h>

int main() {

char str[200];

int i = 0, count = 0;

printf("Enter a sentence: ");

fgets(str, 200, stdin); // Safe input

// Loop for checking each character

while (str[i] != '\0') {

if (str[i] == 'a' || str[i] == 'e' || str[i] == 'i' || str[i] == 'o'


|| str[i] == 'u' ||

str[i] == 'A' || str[i] == 'E' || str[i] == 'I' || str[i] == 'O'


|| str[i] == 'U') {

count++;

i++;

// Result print

printf("Number of vowels in the sentence: %d\n", count);

return 0;

}
Output 

Q27 C Program to Compare Two Strings whether alphabetically greater less or


equal

Code 

#include <stdio.h>

#include <string.h>

int main() {

char str1[100], str2[100];

printf("Enter first string: ");

fgets(str1, 100, stdin);

printf("Enter second string: ");

fgets(str2, 100, stdin);

str1[strcspn(str1, "\n")] = 0;

str2[strcspn(str2, "\n")] = 0;

// String compare

int result = strcmp(str1, str2);

if (result == 0)

printf("Both strings are equal.\n");

else if (result < 0)

printf("First string is alphabetically smaller than second.\n");


else

printf("First string is alphabetically greater than second.\n");

return 0;

Output

Q28 C Program to convert a line in lower to uppercase letter

Code

#include <stdio.h>

#include <string.h>

int main() {

char str[100];

printf("Enter a sentence in lowercase: ");

fgets(str, 100, stdin);

str[strcspn(str, "\n")] = 0;

strupr(str);

printf("Uppercase: %s\n", str);

return 0;
}

Output

Q29 C Program to find the longest word in a given string

Code

#include <stdio.h>

int main() {

char str[200], longestWord[50], tempWord[50];

int i = 0, j = 0, maxLength = 0, wordLength = 0;

printf("Enter a sentence: ");

fgets(str, 200, stdin);

while (str[i] != '\0') {

if (str[i] != ' ' && str[i] != '\n') {

tempWord[j] = str[i]; // Word store

j++;

wordLength++;

} else {

tempWord[j] = '\0'; // Word terminate

if (wordLength > maxLength) {


maxLength = wordLength;

// Longest word copy

int k;

for (k = 0; tempWord[k] != '\0'; k++) {

longestWord[k] = tempWord[k];

longestWord[k] = '\0';

j = 0; // rest for Next word

wordLength = 0;

i++;

// Output longest word

printf("Longest word: %s\n", longestWord);

printf("Length: %d\n", maxLength);

return 0;

Output
Q30C program to arrange names in alphabetical order

Code

#include <stdio.h>

#include <string.h>

int main() {

char names[10][50], temp[50];

int n, i, j;

printf("Enter number of names: ");

scanf("%d", &n);

getchar();

// Names input

printf("Enter %d names:\n", n);

for (i = 0; i < n; i++) {

fgets(names[i], 50, stdin);

names[i][strcspn(names[i], "\n")] = '\0'; // Newline remove

// **Bubble Sort**

for (i = 0; i < n - 1; i++) {

for (j = i + 1; j < n; j++) {

if (strcmp(names[i], names[j]) > 0) { // Alphabetical order check

strcpy(temp, names[i]);

strcpy(names[i], names[j]);

strcpy(names[j], temp);

}
// **Sorted names print**

printf("\nNames in alphabetical order:\n");

for (i = 0; i < n; i++) {

printf("%s\n", names[i]);

return 0;

Output

Q31 C program to find the arithmetic mean of a given list of n real values
using pointers

Code

#include <stdio.h>

int main() {

int n, i;

float numbers[100], sum = 0, mean;


float *ptr; // Pointer declare

printf("Enter number of values: ");

scanf("%d", &n);

printf("Enter %d real numbers:\n", n);

for (i = 0; i < n; i++) {

scanf("%f", &numbers[i]);

ptr = numbers;

for (i = 0; i < n; i++) {

sum += *(ptr + i);

// Mean calculate

mean = sum / n;

// Output mean

printf("Arithmetic Mean = %.2f\n", mean);

return 0;

Output
Q32 C program to Declare a Two-Dimensional Array of Pointers

Code

#include <stdio.h>

int main() {

int rows = 2, cols = 2;

int a[2][2] = {{10, 20}, {30, 40}}; // Normal 2D array

int *ptr[2][2]; // 2D Array of Pointers

// **Pointers values assign **

for (int i = 0; i < rows; i++) {

for (int j = 0; j < cols; j++) {

ptr[i][j] = &a[i][j]; // storing address in pointers

// **Values print using Pointers**

printf("Values using 2D array of pointers:\n");

for (int i = 0; i < rows; i++) {

for (int j = 0; j < cols; j++) {

printf("%d ", *ptr[i][j]);


}

printf("\n");

return 0;

Output

Q33 C Program to Find the Largest Element in an Array using Pointers

Code 

#include <stdio.h>

int main() {

int n, i, *ptr, max;

printf("Enter number of elements: ");

scanf("%d", &n);

int arr[n]; // Array declare

printf("Enter %d elements:\n", n);

for (i = 0; i < n; i++) {


scanf("%d", &arr[i]);

ptr = arr;

max = *ptr;

for (i = 1; i < n; i++) {

if (*(ptr + i) > max) {

max = *(ptr + i);

printf("Largest element in array = %d\n", max);

return 0;

Output

Q34 C Program to Swap Two Numbers using pointer

Code

#include <stdio.h>

int main() {
int a, b, temp; int *p1, *p2;

printf("Enter two numbers: ");

scanf("%d %d", &a, &b); p1 = &a; p2

= &b;

// Swap using pointers

temp = *p1;

*p1 = *p2;

*p2 = temp;

printf("After swapping: a = %d, b = %d\n", a, b);

return 0;

Output

Q35 C program to add two numbers using pointer.

Code 

#include <stdio.h>

int main() {

int a, b, sum;

int *p1, *p2; // Pointers declare

// User input
printf("Enter two numbers: ");

scanf("%d %d", &a, &b);

p1 = &a;

p2 = &b;

sum = *p1 + *p2;

// Sum print

printf("Sum = %d\n", sum);

return 0;

Output

Q36 C Program to Sort an Array using Pointers

Code

#include <stdio.h>

int main() {

int n, i, j, temp;

int arr[100], *p;


printf("Enter number of elements: ");

scanf("%d", &n);

printf("Enter %d elements:\n", n);

for (i = 0; i < n; i++) {

scanf("%d", &arr[i]);

p = arr;

// Bubble Sort using pointer

for (i = 0; i < n - 1; i++) {

for (j = 0; j < n - i - 1; j++) {

if (*(p + j) > *(p + j + 1)) { // Compare using pointer

temp = *(p + j);

*(p + j) = *(p + j + 1);

*(p + j + 1) = temp;

printf("Sorted array: ");

for (i = 0; i < n; i++) {

printf("%d ", *(p + i)); // Print using pointer

return 0;

Output
Q37 C Program to Store Information of a Students Using Structure

Code 

#include <stdio.h>

// Structure for student

struct Student {

char name[50];

int roll;

float marks;

};

int main() {

struct Student s; // Structure variable declare

printf("Enter name: ");

scanf("%s", s.name);

printf("Enter roll number: ");

scanf("%d", &s.roll);

printf("Enter marks: ");

scanf("%f", &s.marks);
// Student info print

printf("\nStudent Information:\n");

printf("Name: %s\n", s.name);

printf("Roll Number: %d\n", s.roll);

printf("Marks: %.2f\n", s.marks);

return 0;

Output

Q38 C Program to Store Information of 10 Students Using Structure

Code

#include <stdio.h>

// Structure for student

struct Student {

char name[50];

int roll;

float marks;

};
int main() {

struct Student s[10];

int i;

printf("Enter information of 10 students:\n");

for (i = 0; i < 10; i++) {

printf("\nEnter details for student %d:\n", i + 1);

printf("Enter name: ");

scanf("%s", s[i].name);

printf("Enter roll number: ");

scanf("%d", &s[i].roll);

printf("Enter marks: ");

scanf("%f", &s[i].marks);

printf("\nStudent Information:\n");

for (i = 0; i < 10; i++) {

printf("\nStudent %d:\n", i + 1);

printf("Name: %s\n", s[i].name);

printf("Roll Number: %d\n", s[i].roll);

printf("Marks: %.2f\n", s[i].marks);

return 0;

Output

1.Entering Data
2.Storing Data
Q39 c program to read details of n students and print the list of students
who have scored 75 marks and above

Code

#include <stdio.h>
int main() {

int n, i;

printf("Enter number of students: ");

scanf("%d", &n);

char name[n][50];

int roll[n], marks[n];

// Input details

for (i = 0; i < n; i++) {

printf("Enter name: ");

scanf("%s", name[i]);

printf("Enter roll number: ");

scanf("%d", &roll[i]);

printf("Enter marks: ");

scanf("%d", &marks[i]);

// Printing students with 75+ marks

printf("\nStudents scoring 75 and above:\n");

for (i = 0; i < n; i++) {

if (marks[i] >= 75) {

printf("Name: %s, Roll No: %d, Marks: %d\n", name[i], roll[i],


marks[i]);

return 0;

Output

You might also like