• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
projectsgeek

ProjectsGeek

Download Mini projects with Source Code, Java projects with Source Codes

  • Home
  • Java Projects
  • C++ Projects
  • VB Projects
  • PHP projects
  • .Net Projects
  • NodeJs Projects
  • Android Projects
    • Project Ideas
      • Final Year Project Ideas
      • JSP Projects
  • Assignment Codes
    • Fundamentals of Programming Language
    • Software Design Laboratory
    • Data Structure and Files Lab
    • Computer Graphics Lab
    • Object Oriented Programming Lab
    • Assembly Codes
  • School Projects
  • Forum

C Codes

Simple Bus Reservation System in C Program

September 30, 2022 by ProjectsGeek Leave a Comment

 A simple bus reservation system must be simple to use without any complex navigation mechanisms. This is because not everyone using the system would be tech savvy and would understand the nuances of programming. A widely acceptable system is such that it can run on any operating system, is easy to view, and is accessible to everyone. One must not be spending an inordinate time trying to fathom the whereabouts of information whilst booking a seat on a bus. The data stored should be easily retrievable and the system responsive, robust, and devoid of physical boundaries.

Simple Bus Reservation System

The Existing System

The reason why a new Simple Bus Reservation System had to be built from scratch is that the existing one was a mess. It had all the failings of a project gone awry. One of the main aspects of any reservation system is data security. Many would book seats using credit and debit cards and that information must be protected, legally and professionally. There was no additional information provided like driver name, the distance between source and destination et al. The overall look and feel of the Simple Bus Reservation System application too warranted much work since it wasn’t easy to navigate.

The New System

The new system is a simple yet effective Simple Bus Reservation System, which allows a person to enter the number of tickets, seat number, and the name under which the tickets are going to be booked. The user is provided with a bus list and the number of seats available. The records can also be modified if one feels that incorrect information has been inserted. If the bus number is known, then one can insert the bus number too to check the number of seats available. Since the program is built on C, a code editor must be installed to run the program effectively.

Simple Bus Reservation System Modules

Like all applications, this system too has been categorized under 3 modules.

Admin Module

The owner of the Simple Bus Reservation System application will have access to all parts of the system. Any changes in the backend will only be done by the admin. If the menus need to be changed or records modified, then the admin will be authorized to carry out such activities.

User Interface

The graphical user interface is attractive and user-friendly. The entire process is menu driven and the navigability of the application is its brightest spot.

Report Generation

Once the ticket has been booked, a report is generated to provide the user with all the relevant information. The reports can also be exported in PDF or shared through SMS and WhatsApp. It is an easy and quick process and requires only a single click of the mouse.

Hardware configuration

  • Processor Pentium IV
  • Processor speed 2.4GHz
  • RAM 256 MB
  • Monitor Standard Color Monitor
  • Hard disk 40 GB
  • Keyboard Multimedia Standard 102 keys keyboard
  • Mouse Scrollable 3 buttons

Software configuration

  • Operating system Windows 2003/XP, Solaris/Linux

Download Simple Bus Reservation System

Simple Bus Reservation System

Other Projects to Try:

  1. Bus Ticket Reservation System Project
  2. Bus Booking System Project
  3. Railway Ticket Reservation System in C++
  4. Hotel Reservation Project using Android
  5. Airline Reservation System Java Project

Filed Under: C Codes Tagged With: C & C++ Projects

Reading from file using C | easy method

February 17, 2020 by ProjectsGeek Leave a Comment

Reading from file using C

Files are used for storing data as a sequence of bytes either as text or in binary format. This article will show you how Reading from file using C works and writing code for it. Text files (.txt files) are created easily by using simple text editors which can be maintained in a easy manner whereas binary file (.bin files in your computer) stores data as 0s and 1s which cannot be easily readable ensures more security than text files. Storage space required for binary file is less.

One of the IDE which can be used for c code writing is codeblocks.

Reading from file using C

Data stored in these files can be handled by using C. Operations like reading or writing in existing file, creating new file and closing a file can be done by C. Now lets see how to reading from file using C works.

Reading from file using C

C language program read the file which was entered by user and output its information on the screen. While working with file, you need to create a pointer variable for type file. This variable is used for the file and program communication. The program file which executes a file should be in same directory in which file to be read is present.

Standard Input and output functions in C are predefined structures in header file stdio.h. Function used to open a file is fopen(), it returns a pointer to stdio.h file when file successfully opened else it returns NULL. While opening a file we are bringing data from disk or from storage devices to RAM where operations can be performed on it [like reading, editing].The prototype of fopen function is —-

Fopen ( const char * filename, const char * mode )

 Filename is a string in which you use the name your file and access mode has one of the following values.

r – Opens a file for reading purpose.

w – Opens a file for writing purpose, if file doesn’t exist it creates a new one.

a – Opens a file for writing in appending mode where it start appending content in the existing file with the new created one  . And r+, w+, a+ are also the mode that works with combination of above modes.

               Example: fopen(sample.txt, “r”);    —-> here sample.txt file is opened in reading mode .you can just read its content, can’t edit or so.

A character that is read from the file is returned by function fgetc(). Closing of file is done by fclose () function.

C program to read a file

Code in C programming to open a file and display its contents on screen.

#include <stdio.h>
#include <stdlib.h>

int main()
{
char ch, file_name[25];
FILE *fip;

printf("Enter the file name to read\n");
gets(file_name);

fip = fopen(file_name, "r");    // read mode

if (fip == NULL)
{
perror("Error while opening the file.\n");
exit(EXIT_FAILURE);
}

printf("The contents of %s file are:\n", file_name);

while((ch = fgetc(fip)) != EOF)
printf("%c", ch);

fclose(fip);
return 0;
}

Pointer variable we used here is fip which return NULL when it can’t find the requested file. Perror() function print the error message. When we compile and run the above program, if it displays the following message, then it means we are trying to open a file that does not exist.

reading file using c easy method

                              “Error while opening the file”

Otherwise the content in the file is read by fgetc() function. This function read a character and print it using printf() function where % c is the datatype of character to be printed. This process repeats till the end of file [EOF] using while loop. EOF macro is a negative value with int datatype, that is returned by functions to know end-of-file [i.e  No more data from stream]. EOF is defined in header file stdio.h (and is usually -1). Once file reading is done file is closed by fclose() function. You can other c projects or c++ projects here.

Other Projects to Try:

  1. To Perform File Handling in Java
  2. Primitive operations on Sequential file in C language
  3. File Handling and IO Handling in Java Programming
  4. File Handling program using Java
  5. Text or Screen Editor in C++ Language

Filed Under: C Codes Tagged With: C++ Projects

Reverse Digits of Number in C Language

July 11, 2013 by ProjectsGeek Leave a Comment

Reverse Digits of Number in C Language

Write a Reverse Digits of Number in C to reverse the digits of a given integer. User needs to provide the number initially to the program,then program will reverse the digits of number.

Reverse Digits of Number in C Program will divide the number by 10 continuously to get the digits as separate entities. After separating all digits it will rebuild the number by multiplying digits by 10*n to get reverse number.

Reverse Digits of  Number in C Code

#include<stdio.h>
#include<conio.h>
void main()
{
int num,rev=0,dig;
clrscr();
//accept the number to be reversed
printf(“Enter number:\t”);
scanf(“%d”,&num);

while(num>0)
{

dig=num%10; 
rev=(rev*10)+dig; 
num=num/10; 
}

printf(“Reversal of number:=%d “,rev);
getch();
}

 Reverse Digits of Number in C code Output

Reverse Digits of Number in C

Other Projects to Try:

  1. How to Implement Hash Table using C language
  2. Hash table code in C Language
  3. Single Link List code using C Language
  4. Display Numbers in Ascending Order C language
  5. String Operations in C Program

Filed Under: C Codes

Find prime numbers in C Language

July 7, 2013 by ProjectsGeek Leave a Comment

Prime numbers in C Language

Write a prime numbers in C Language program to generate prime numbers between 1 and n. User has to enter range of prime numbers and then program will print the prime numbers Between 1 to n.

prime numbers in C

We can find infinitely many prime numbers. Another way of saying this is that the sequence

2, 3, 5, 7, 11, 13, 17 ,19 and so on …… So you can find infinite number of prime Numbers.

Prime numbers in C Language Code

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int i=0,j=0,c=0,n;
printf(“\nenter range for prime numbers:”);
scanf(“%d”,&n);
printf(“\n The prime numbers between 1 to %d are: \n”,n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
if(i%j==0)
c++;
}
if(c<=2)
printf(“%d “,i);
c=0;
}
getch();
}

 

Other Projects to Try:

  1. Fibonacci numbers program in C Language
  2. How to Implement Hash Table using C language
  3. Assembly Language Codes
  4. Multiply Two 8 Bit Numbers in Assembly Language
  5. GCD of Two Numbers program in Assembly Language

Filed Under: C Assignments

GCD of two integers Code in C Language

July 7, 2013 by ProjectsGeek Leave a Comment

GCD of two integers Code in C Language

Write a GCD of two integers program in C to compute the GCD of the given two integers .User need to enter two numbers a and b,which needs to be use to find GCD of two numbers.

You can take the example, the GCD(greatest common divisor) of 8 and 12 is 4.

GCD of two Numbers

GCD of two integers Code

#include<stdio.h>
int gcd(int a, int b);
int gcd_recurse(int a, int b);
int main()
{
int a,b;
clrscr();
printf(“\nenter two nos to caluculate GCD:”);
scanf(“%d%d”,&a,&b);
printf(“\nGCD(%2d,%2d) = [%d]“, a,b, gcd(a,b));
printf(“\nGCD(%2d,%2d) = [%d]“, a,b, gcd_recurse(a,b));
getch();
return(0);
}

int gcd(int a, int b)
{
int temp;
while(b)
{
temp = a % b;
a = b;
b = temp;
}
return(a);
}

int gcd_recurse(int a, int b)
{
int temp;
temp = a % b;
if (temp == 0)
{
return(b);
}
else
{
return(gcd_recurse(b, temp));
}
}

 

Other Projects to Try:

  1. N queen problem code in C Language
  2. Regular Expression to DFA Code in C Language
  3. Prims algorithm Code in C Language
  4. GCD of Two Numbers program in Assembly Language
  5. Assembly Language Codes

Filed Under: C Assignments

Factorial of a number using recursion in C

July 7, 2013 by ProjectsGeek Leave a Comment

Factorial of a number using recursion in C Language

 

Write a Factorial of a number in C program to compute the factorial of the given positive integer using recursive function.

User needs to enter the positive Integer whose factorial needs to be found and after the program will print the factorial of integer. Function rec (int num) is function which will be called recursively to find the Factorial of a number.

Factorial of a number using recursion

 

Factorial of a number using recursion in C

#include <stdio.h>
#include<conio.h>

int rec(int num); 

void main()
{
int num, fact;
printf(“\nEnter any number: “);
scanf (“%d”, &num);
fact=rec (num);
printf(“\nFactorial Value = %d”, fact);
getch();
}

int rec (int num) 
{
int f;
if (num==1)
return (1);
else
f=num*rec(num-1);

return (f);
}

 Factorial of a number using recursion in C Code

Other Projects to Try:

  1. String Operations with Pointers
  2. String Operations in C Program
  3. Quick sort using recursion
  4. Factorial,Greatest Number, Palindrome AWK
  5. Factorial,Greatest Number,String Palindrome Shell code

Filed Under: C Codes

  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Go to Next Page »

Primary Sidebar

Tags

.Net Projects Download Android Project Ideas Android Projects Angular 2 Assembly Codes C # Projects C & C++ Projects C++ Projects Class Diagrams Computer Graphics Database Project Data Mining Projects DataScience Projects Datastructure Assignments Download Visual Basic Projects Electronics project Hadoop Projects Installation Guides Internet of Things Project IOS Projects Java Java Interview Questions Java Projects JavaScript JavaScript Projects java tutorial JSON JSP Projects Mechanical Projects Mongodb Networking Projects Node JS Projects OS Problems php Projects Placement Papers Project Ideas Python Projects seminar and presentation Struts

Search this Website


Footer

Download Java Project
Download Visual Basic Projects
Download .Net Projects
Download VB Projects
Download C++ Projects
Download NodeJs Projects
Download School Projects
Download School Projects
Ask Questions - Forum
Latest Projects Ideas
Assembly Codes
Datastructure Assignments
Computer Graphics Lab
Operating system Lab
australia-and-India-flag
  • Home
  • About me
  • Contact Form
  • Submit Your Work
  • Site Map
  • Privacy Policy