GauravSingh2[1]

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

A

REPORT
ON
INDUSTRIAL TRAINING ON
“Programming with C and C++”
Taken at

INTERNSHALA TRAININGS
In partial fulfillment of the requirement for the award of degree of
Bachelor of Technology
In
Department of Artificial Intelligence & Data Science

(Session 2024-25)

Duration: 15 July, 2024 to 7 September, 2024

Submitted to: Submitted by:


Mr. Rahul Guha Gaurav Singh
Assistant prof. 23EJCAD032
AI&DS III Semester (A)
JECRC, Jaipur

Department of Artificial Intelligence and Data Science


Jaipur Engineering College & Research Centre, Jaipur
Rajasthan Technical, University
November – 2024
1
INDEX
S. No. TITLE

1. Certificate

2. Declaration

3. Preface

4. Acknowledgement

5. Company Profile

6. Introduction

7. 7.1 About C++

7.2 Scope

7.3 Features

8. Overview

9. Features

10. Game 2: Tic-Tac-Toe

11. Screenshots

12. Conclusion

13. Future Scope

14. References

2
CERTIFICATE

This is to certify that the report of the training is the outcome of the practical training done at
INTERNSHALA in “Programming with C and C++” is carried out by GAURAV SINGH bearing
RTU Roll NO. 23EJCAD062 under the guidance and supervision of “Sarvesh Agarwal” for the award
of degree of Bachelor of Technology(B.Tech) in department of Artificial Intelligence and Data
Science from JECRC, Jaipur(Raj.), India affiliated to Rajsthan Technical University, Kota during the
academic year 2024-25.

To the best of my knowledge the report

1. Embodies the work of candidate


2. Has duly been submitted
3. Is up to the desired standard for the purpose of which is submitted

Dr. Manju Vyas Mr. Rahul Guha

Head of Department Assistant Prof.

AI&DS JECRC, Jaipur

JECRC, Jaipur
3
DECLARATION
I hereby declare that the report entitled “Programming with C and C++” has been carried out and
submitted by the undersigned to the Jaipur Engineering College & Research Centre, Jaipur
(Rajasthan) in an original work, conducted under the guidance and supervision of Mr. Madhusudhan
of INTERNSHALA.

The empirical findings in this report are based on the data, which has been collected by me. I have
not reproduced from any report of the University neither of this year nor of any previous year.

I understand that any such reproducing from an original work by another is liable to be punished in a
way the University authorities’ deed fit.

Place: Jaipur Gaurav Singh

Date: 26.11.2024 23EJCAD062

4
PREFACE

Bachelor of Technology in Artificial Intelligence and Technology is the Rajasthan Technical


University course (Approved by AICTE) having duration of 4 years. As a prerequisite of the syllabus
every student on this course has to take professional training from any Industry related to the stream
for 60 days in order to complete his/her studies successfully. And it is required to submit the project
report on the completion of it.

The main objective of this training is to create awareness regarding the application of theories in the
practical world of AI&DS and to give a practical exposure of the real world to the student.

I, therefore, submit this project report of this training, which was undertaken with Internshala
Trainings. It was a good experience to have training in a Reputed Learning Organization in the C and
C++ languages.

I feel great pleasure to present this project report. The report was prepared to brief about my training
project ‘a mini game collection’.

5
ACKNOWLEDGEMENT

“Any serious and lasting achievement or success, one can never achieve without the help, guidance
and co-operation of so many people involved in the work.

It is my pleasant duty to express my profound gratitude and extreme regards and thanks to Mr.
Sarvesh Agarwal who gave me an opportunity to take professional training in Internshala.

I am indebted towards Mr. Madhusudhan who has allotted this project and his precious time and
advice during the training period, which is imminent to the report.

I would like to express deep gratitude to Dr Manju Vyas, Head of Department (Artificial Intelligence
and Data Science), Jaipur Engineering College & Research Centre, Jaipur (Rajasthan) without whose
permission the training would not be possible. I would also like to thank Ms. Rahul Guha, Assistant
Professor, Department of AI&DS JECRC, Jaipur who recommended me for this training.

Last but not the least, I am grateful to GOD for blessing me. I am heartily thankful to those people
who are involved directly or indirectly in this project for encouraging me whenever I needed their
help in spite of their busy schedule.

Gaurav Singh

23EJCAD062

6
COMPANY PROFILE
Internshala Trainings, established in 2016, is a prominent career-tech platform based in Gurgaon,
India. The platform is dedicated to providing students with the necessary skills and knowledge to
build successful careers. With a wide range of online trainings and practical projects, Internshala
Trainings aims to bridge the gap between academic learning and industry demands.

Mission: Internshala Trainings is on a mission to make quality education accessible to every student.
The goal is to enable students to learn at their own pace, from anywhere in the world, and at an
affordable cost. By doing so, Internshala Trainings hopes to empower students to achieve their career
aspirations and contribute meaningfully to the workforce.

Services: Internshala Trainings offers various services designed to enhance students’ learning
experiences and career prospects:

1. Online Trainings: Comprehensive courses covering various subjects, delivered through


engaging and easy-to-understand video tutorials.

2. Hands-on Practice: Interactive quizzes, tests, and projects that allow students to apply their
knowledge in real-world scenarios.

Internshala Trainings is committed to transforming the educational landscape by providing students


with the tools and resources they need to succeed in their careers. With a focus on practical learning
and job readiness, Internshala Trainings continues to be a valuable resource for students across India.

7
WHAT IS C?
Overview: C is a highly efficient, general-purpose programming language that was developed by
Dennis Ritchie at Bell Labs in the early 1970s. Initially designed for system programming and writing
operating systems, C quickly gained popularity due to its performance, portability, and
straightforward syntax.
Features of C:
1. Low-Level Access: C provides low-level access to memory using pointers, which allows for
efficient manipulation of hardware resources.
2. Simple Syntax: The language’s syntax is clean and easy to understand, making it a great
starting point for learning more complex languages.
3. Standard Library: C comes with a comprehensive standard library that includes functions
for input/output operations, memory management, string handling, and more.
4. Portability: C code can be compiled and run on various platforms with minimal changes,
making it highly portable.
5. Efficiency: Programs written in C are generally faster and more memory-efficient compared
to those written in higher-level languages.

Applications in Game Development: C is widely used in game development due to its performance
and close-to-hardware capabilities. Many classic and modern games, as well as game engines, are
built using C or C-based languages (like C++). Here’s why C is a good choice for game development:
1. Performance: Games often require real-time performance and efficient memory usage. C
allows developers to fine-tune their code for maximum performance.
2. Hardware Control: Games frequently need to interact with hardware components like
graphics cards and input devices. C’s ability to handle low-level operations makes this
possible.
3. Game Engines: Many game engines, including early versions of famous engines like Unreal
Engine, have been developed in C. These engines provide the backbone for numerous popular
games.
4. Embedded Systems: For games on embedded systems or consoles, C is the preferred
language due to its efficiency and direct hardware access.
The C programming language remains a cornerstone of game development due to its performance,
efficiency, and low-level capabilities. By utilizing C for your mini game collection project, you
are leveraging a powerful tool that has shaped the gaming industry for decades. This project not
only demonstrates your understanding of C but also showcases how classic games can be brought
to life through programming.

8
Features:
1.Interactive Gameplay: Each game in the collection provides a dynamic and engaging user
experience, ensuring players remain interested and entertained throughout their play sessions.
2.User-Friendly Interface: The games feature simple, text-based interfaces that are easy to navigate,
making them accessible to players of all ages and skill levels.
3.Randomization: Elements of randomness, such as the generation of random numbers in "Guess
the Number" and the random selection of words in "Hangman," enhance the replayability and
excitement of the games.
4.Error Handling: The games include basic error handling mechanisms to manage invalid inputs
and ensure smooth gameplay. For instance, user prompts are clear and guide players in making valid
selections.
5.Modularity: Each game is implemented as a separate function, ensuring the code is modular and
easy to maintain. This modularity also makes it straightforward to add new games to the collection
in the future.
6.Educational Value: The project serves as an excellent educational tool, helping learners
understand and apply fundamental programming concepts such as loops, conditionals, arrays,
functions, and random number generation through practical application.
7.Scalability: The design of the mini game collection allows for easy scalability. New games can be
added without major modifications to the existing codebase, making it a versatile framework for
future expansions.
8.Cross-Platform Compatibility: The games are developed in C, ensuring they can be compiled and
run on various platforms with minimal changes. This cross-platform compatibility broadens the reach
and usability of the game collection.
9.Replayability: The games are designed to be replayable, providing different outcomes and
experiences with each playthrough. This keeps the games fresh and enjoyable over time.

9
GAME: TIC-TAC-TOE
Tic Tac Toe is a classic two-player game where players take turns marking 'X' and 'O' on a 3x3 grid.
The first player to align three of their marks horizontally, vertically, or diagonally wins the game.
This implementation features a human player and a computer opponent.
The main goal is for players to achieve a sequence of three consecutive 'X' or 'O' marks. The game
tests strategic thinking and foresight, as players must plan their moves while anticipating their
opponent's actions.
Code Explanation:
Initialization: The [initializeBoard()] function sets up an empty 3x3 grid.
Print Board: The [printBoard()] function displays the current state of the board with row and column
indices.
Win Check: The [checkWin()] function checks if a player has won by forming a line horizontally,
vertically, or diagonally.
Draw Check: The [isDraw()] function checks if the board is full and the game is a draw.
Player Move: The [playerMove()] function captures the player's move and updates the board.
Computer Move: The [computerMove()] function randomly selects an empty cell for the computer's
move.
Game Loop: The main game loop alternates between player and computer moves, checking for a
win or draw after each move.

10
SCREENSHOTS

11
CONCLUSION
This mini game collection project, developed using the C programming language, successfully
demonstrates the versatility and efficiency of C in creating interactive and engaging applications. By
integrating four classic games—Tic Tac Toe, Guess the Number, Hangman, and Rock Paper
Scissors—we showcased the broad range of capabilities offered by C, from handling user input to
managing game state and logic.
Through this project, we aimed to create a user-friendly and enjoyable game collection that could be
easily expanded and customized. The games' simple text-based interfaces ensure accessibility for
players of all ages and skill levels, while the elements of randomness and replayability keep the
gameplay fresh and exciting.
Additionally, this project serves as an excellent educational tool for aspiring programmers. It offers
hands-on experience with core programming concepts and emphasizes the importance of user
feedback, error handling, and maintaining a clean and modular codebase. By working on these games,
learners can enhance their problem-solving skills, logical reasoning, and strategic thinking.
In conclusion, the mini game collection project successfully demonstrates the enduring relevance of
the C programming language in modern software development. It provides a robust foundation for
both entertainment and education, showcasing the power and flexibility of C in creating interactive
and efficient applications. The project underscores the importance of C in game development and its
continued significance in the broader programming landscape.

12
FUTURE SCOPE
1. Additional Games: Add more games like Sudoku, Minesweeper, and Memory Match to
increase variety.

2. Multiplayer Functionality: Implement both local and online multiplayer modes to allow
players to compete with each other.

3. AI Improvements: Enhance AI algorithms to make the computer opponents more


challenging and adaptive.

4. Customization and Settings: Allow players to customize game settings, such as difficulty
levels and themes.

5. Sound and Music: Add sound effects and background music to make the games more
immersive.

6. Educational Features: Include tutorials and help sections to guide new players and provide
learning modes with hints and tips.

7. Mobile and Web Versions: Develop mobile apps for Android and iOS and create a web-
based version to make the games accessible on various devices.

8. Community and Social Features: Implement leaderboards, achievements, and player


profiles to foster a competitive and social gaming environment.

13
REFERENCES

Books:

• "Let Us C" by Yashavant Kanetkar

Online Training:

• Internshala Trainings: https://trainings.internshala.com

Websites:

• GeeksforGeeks: https://www.geeksforgeeks.org/c-programming-language

• Google: https://www.google.com

• Programiz: https://www.programiz.com/c-programming

14

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy