FYBScIT Practicals
FYBScIT Practicals
FYBScIT Practicals
Practical 1
C Programming + DBMS
INDEX
Sr Practical Sign
No.
1 a) To calculate simple interest taking principal, rate of interest and number of
years as input from user. Write algorithm & draw flowchart for the same.
b) Write a program to find greatest of three numbers using conditional
operator. Write algorithm & draw flowchart for the same.
c) Write a program to check if the year entered is leap year or not. Write
algorithm & draw flowchart for the same.
2 a) Write a program to calculate roots of a quadratic equation.
b) Write a menu driven program using switch case to perform add / subtract/
multiply / divide based on the users choice.
c) Write a program to print the pattern of asterisks.
3 a) Write a program using while loop to reverse the digits of a number.
b) Write a program to calculate the factorial of a given number.
c) Write a program to print the Fibonacci series.
4 a) Write a program to print area of square using function.
b) Write a program using recursive function.
c) Write a program to square root, abs () value using function.
d) Write a program using goto statement.
5 a) Write a program to print rollno and names of 10 students using array.
b) Write a program to sort the elements of array in ascending or descending
order.
6 a) Write a program to extract the portion of a character string and print the
extracted part.
b) Write a program to find the given string is palindrome or not.
c) Write a program to using strlen(), strcmp() function .
7 Write a program to swap two numbers using a function. Pass the values to be
swapped to this function using call-by-value method and call-by-reference
method.
8 a) Write a program to read a matrix of size m*n.
b) Write a program to multiply two matrices using a function.
9 Write a program to print the structure using
Title
Author
Subject
Book ID
Print the details of two students.
10 Create a mini project on “Bank management system”. The program should be
menu driven.
Practical No.: 01
1. A) To calculate simple interest taking principal, rate of interest and number of years as input from user. Write
algorithm & draw flowchart for the same.
Solution:
Algorithm
Step1: Start
Step2: Input principal (P), rate of interest (R), and number of years (T)
Step3: Calculate Simple Interest (SI) using the formula: SI = (P * R * T)/100
Step4: Output the Simple Interest (SI)
Step5: End
Flowchart:
#include <stdio.h>
int main()
{
// Variables to store user inputs
scanf("%f", &R);
scanf("%f", &T);
return 0;
Output:
Solution:
Algorithm:
Step1: Start
Step6: End
Flowchart:
#include<stdio.h>
int main()
{
int a,b,c;
return 0;
}
Output:
Solution:
Algorithm:
Step1: Start
Step3: Check if the year is divisible by 4 but not by 100 using if-else statements and logical operator.
Step4: And Also check if the variable is divisible by 400 using the logical operator or.
Step5: If either of the two conditions is satisfied, then print that the given year is a leap year.
Step7: End
Flowchart:
#include <stdio.h>
int main()
{
int year;
return 0;
}
Output:
Solution:
−b ± √ b2−4 ac
We’ll need to use Quadratic Formula: x=
2a
Source Code:
Output:
2. B) Write a menu driven program using switch case to perform add / subtract / multiply / divide based on the
users choice.
Solution:
Solution:
Solution:
Source Code:
#include <stdio.h>
void main() {
int num, rev = 0, rem;
while(num != 0) {
rem = num % 10;
rev = rev * 10 + rem;
num /= 10;
}
Output:
Solution:
Source Code:
Output:
Solution:
Source Code:
Output:
Practical No.: 04
Solution:
Source Code:
Output:
Solution:
Source Code:
Output:
Solution:
Source Code:
Output:
Solution:
Source Code:
Output:
Practical No.: 05
Solution:
Source Code:
Output:
Solution:
Source Code:
Output:
Practical No.: 06
a. Write a program to extract the portion of a character string and print the extracted part.
Solution:
Source Code:
Output:
Solution:
Source Code:
Output:
Solution:
Source Code:
Output:
Practical No.: 07
Write a program to swap two numbers using a function. Pass the values to be swapped to this function using
call-by-value method and call-by-reference method.
Solution:
Source Code:
Output:
Practical No.: 08
Solution:
Source Code:
Output:
Solution:
Source Code:
Output:
Practical No.: 09
Title
Date: ` Programming with C + DBMS
FY-B.Sc-IT RollNo.:
Author
Subject
Book ID
Solution:
Source Code:
Output:
Practical No.: 10
Create a mini project on “Bank management system”. The program should be menu driven.
Solution:
Source Code:
Output: