Practical Question Till 8
Practical Question Till 8
#include <stdio.h>
int main() {
if (c1 != r2) {
return 0;
scanf("%d", &a[i][j]);
scanf("%d", &b[i][j]);
// Ini alize mul to 0
mul[i][j] = 0;
prin ("\n");
return 0;
#include <stdio.h>
int main() {
scanf("%d", &a[i][j]);
trans[j][i] = a[i][j];
prin ("\n");
return 0;
#include <stdio.h>
#include <string.h>
int main() {
scanf("%s", str[i]);
// Bubble sort
strcpy(str[i], str[j]);
strcpy(str[j], temp);
return 0;
Q4 WRITE A C PROGRAM TO TWO STRINGS S1, S2 & CHECK IF S2 IS SUBSTRING OF S1 & ALSO THE POSITION
OF THE SUB STRING IN S1
#include <stdio.h>
#include <string.h>
int main() {
gets(s1);
gets(s2);
if (pos) {
} else {
return 0;
#include <stdio.h>
#include <string.h>
int main() {
gets(s1);
gets(s2);
strcat(s1, s2);
return 0;
Q6 WRITE A C PROGRAM TO FIND THE STUDENT INFORMATION & PRINT THE STUDENT INFORMATION &
RANK SECURED IN ASCENDING ORDER
#include <stdio.h>
#include <string.h>
struct Student {
char name[50];
int marks;
};
int main() {
// Sort by marks
temp = s[i];
s[i] = s[j];
s[j] = temp;
prin ("Name: %s, Marks: %d, Rank: %d\n", s[i].name, s[i].marks, i+1);
return 0;
#include <stdio.h>
} Element;
int k = 1;
if (a[i].col == b[j].row) {
result[k].row = a[i].row;
result[k].col = b[j].col;
k++;
result[0].row = a[0].row;
result[0].col = b[0].col;
result[0].value = k - 1;
int main() {
Element result[MAX];
return 0;
Q8 WRITE A C PROGRAM TO TAKE PARAGRAPH AS INPUT AND OUTPUT NO, OF OCCURRENCES OF STRING IN
PARAGRAPH
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main() {
scanf("%s", word);
int count = 0;
if (strcmp(token, word) == 0)
count++;
return 0;