Computer
Computer
#include <stdio.h>
int main() {
return 0;
OUTPUT
2 NUMBER IS EVEN OR ODD
#include <stdio.h>
int main() {
int num;
scanf("%d", &num);
if (evenodd(num))
else
return 0;
OUTPUT
3 FACTORIAL OF A NUMBER USING RECURSIVE FUNCTION
#include <stdio.h>
if (n == 0 || n == 1)
return 1;
else
int main() {
int num;
scanf("%d", &num);
if (num < 0)
else
#include <string.h>
// Define structure
struct Student {
int id;
char name[50];
char address[100];
};
temp = students[i];
students[i] = students[j];
students[j] = temp;
}
}
int main() {
int n;
scanf("%d", &n);
printf("ID: ");
scanf("%d", &students[i].id);
printf("Name: ");
printf("Address: ");
sortByName(students, n);
return 0;
OUTPUT
#include <string.h>
// Define structure
struct Teacher {
int id;
char name[50];
char address[100];
char subject[50];
};
temp = teachers[i];
teachers[i] = teachers[j];
teachers[j] = temp;
int main() {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
printf("ID: ");
scanf("%d", &teachers[i].id);
printf("Name: ");
printf("Address: ");
printf("Subject: ");
// Sort teachers by ID
sortByID(teachers, n);
return 0;
}
OUTPUT
3. Input 10 Students' Data (Name, Grade, Gender, Marks) and Print
Records with Total and Percentage
#include <stdio.h>
// Define structure
struct Student {
char name[50];
int grade;
char gender;
int marks[5];
int total;
float percentage;
};
int main() {
int n, sum;
scanf("%d", &n);
printf("Name: ");
printf("Grade: ");
scanf("%d", &students[i].grade);
sum = 0;
scanf("%d", &students[i].marks[j]);
sum += students[i].marks[j];
students[i].total = sum;
students[i].percentage = (float)sum / 5;
printf("\nStudent Records:\n");
printf("Name: %s, Grade: %d, Gender: %c, Total: %d, Percentage: %.2f%%\n",
students[i].name, students[i].grade, students[i].gender,
students[i].total, students[i].percentage);
return 0;
}
OUTPUT
Certificate of Approval
This is to certify that the project work entitled C and SQL has been successfully completed and
submitted by Nikas Paudel, a student of Class 12, Section Faraday, Roll Number 24, of
Gorkha International Public Secondary School, Dang.
This project was carried out under the guidance of AI Bhadur Pun in partial fulfillment of the
requirements for Computer Science. The work embodied in this project is original and has been
approved as satisfactory for submission.
Approved By:
__________________________
Subject Teacher
AI Bhadur Pun
__________________________
Science Coordinator
Swotantra Hamal
__________________________
External Examiner
Date: 2025/01/06
Acknowledgment
Nikas Paudel
POINTERS 1. Perform Arithmetic Calculations (Sum, Difference,
Multiplication, Division)
#include <stdio.h>
if (*b != 0) {
} else {
}}
int main() {
arithmeticOperations(&num1, &num2);
return 0;
}
OUTPUT
2. Check if a Number is Even or Odd Using Pointers
#include <stdio.h>
if (*num % 2 == 0) {
} else {
int main() {
int number;
scanf("%d", &number);
checkEvenOdd(&number);
return 0;
OUPUT
3. Swap Two Values Using Call by Reference and Call by Value
*a = *b;
*b = temp;
int main() {
swapByReference(&num1, &num2);
return 0;
}
OUTPUT
int temp = a;
a = b;
b = temp;
int main() {
swapByValue(num1, num2);
OUTPUT
GORKHA INTERNATIONAL PUBLIC SECONDARY SCHOOL DANG
A project work on
C AND SQL
SUBMITTED TO SUBMITTED BY
Sign- Sign-
Declaration
#include <stdio.h>
int main() {
FILE *file;
char name[50];
int roll, n;
if (file == NULL) {
return 1;
scanf("%d", &n);
scanf("%d", &roll);
fclose(file);
return 0;}
2. Read Data from a File
#include <stdio.h>
int main() {
FILE *file;
char ch;
if (file == NULL) {
return 1;
fclose(file);
return 0;
}
3. Append Data to a File
#include <stdio.h>
int main() {
FILE *file;
char name[50];
int roll, n;
if (file == NULL) {
return 1;
scanf("%d", &n);
scanf("%d", &roll);
fclose(file);
return 0;
}
Structured Query Language
*CREATE DATABASE student;
USE student;
student_name VARCHAR(100),
student_address VARCHAR(100),
student_grade INT );