BHUSHAN
BHUSHAN
#include <stdio.h>
int main() {
int arr[] = {5, 3, 9, 1, 7, 2};
int size = sizeof(arr) / sizeof(arr[0]);
int min = arr[0];
int max = arr[0];
return 0;
}
#include <stdio.h>
int main() {
int num1 = 5, num2 = 10, result;
return 0;
}
3. Structure book
#include <stdio.h>
struct book {
char book_name[100];
char author_name[100];
float price;
};
int main() {
int n;
printf("Enter the number of books: ");
scanf("%d", &n);
printf("\nBook Information:\n");
for (int i = 0; i < n; i++) {
printf("\nBook %d:\n", i + 1);
printf("Book Name: %s\n", books[i].book_name);
printf("Author Name: %s\n", books[i].author_name);
printf("Price: %.2f\n", books[i].price);
}
return 0;
}
4. Copy string
#include <stdio.h>
#include <string.h>
int main() {
char s1[20];
char s2[20];
printf("enter any string: ");
fgets(s1, sizeof(s1), stdin);
strcpy(s2, s1);
return 0;
}
5. Write data
#include <stdio.h>
int main() {
FILE *file = fopen("bhushan.txt", "w");
if (file == NULL) {
printf("Error!\n");
return 1;
}
fclose(file);
return 0;
}
6. Transpose of matrix
#include <stdio.h>
int main() {
int matrix[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
int transpose[3][3];
return 0;
}
7. Find power using pointer
#include <stdio.h>
int main() {
int base = 2;
int exponent = 3;
int result;
return 0;
}
8. Length of string without string library functions:
#include <stdio.h>
#include <string.h>
void main() {
char str1[30];
int i, l = 0;
struct student {
char *name;
int age;
};
int main() {
printf("the size of struct student is %d bytes\n", sizeof(struct student));
return 0;
}
#include <stdio.h>
int main() {
int a[3][3][3] = {{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}, {{10, 11, 12}, {13, 14, 15},
{16, 17, 18}}};
int b[3][3][3] = {{{19, 20, 21}, {22, 23, 24}, {25, 26, 27}}, {{28, 29, 30}, {31,
32, 33}, {34, 35, 36}}};
int c[3][3][3];