https://github.com/mohdnehalkhan/c-programs
This Repository contains all basic program's of C programming language for a beginner & I am mentioning all the C programs which I had been taught by my teachers
https://github.com/mohdnehalkhan/c-programs
c
Last synced: about 1 year ago
JSON representation
This Repository contains all basic program's of C programming language for a beginner & I am mentioning all the C programs which I had been taught by my teachers
- Host: GitHub
- URL: https://github.com/mohdnehalkhan/c-programs
- Owner: MOHDNEHALKHAN
- License: unlicense
- Created: 2023-08-16T06:27:37.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-26T07:49:14.000Z (almost 3 years ago)
- Last Synced: 2025-01-16T06:58:01.803Z (over 1 year ago)
- Topics: c
- Language: C
- Homepage:
- Size: 119 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fork and Clone the Repository
1. Go to the GitHub repository you want to fork.
2. Click the "Fork" button in the upper right-hand corner of the repository page.
3. Select your username or organization where you want to fork the repository. This creates a copy of the repository in your GitHub account.
4. Open your terminal (Command Prompt on Windows, Terminal on macOS and Linux).
5. Use this in your terminal
```sh
git clone https://github.com//.git
```
# Running C Programs in Visual Studio Code
This README provides a step-by-step guide on how to execute and run C programs within Visual Studio Code using the "C-program" repository.
## Prerequisites
Before you begin, make sure you have the following installed:
1. **Visual Studio Code**: If you haven't already, download and install Visual Studio Code from the [official website](https://code.visualstudio.com/).
2. **C/C++ Extension**: Install the "C/C++" extension for Visual Studio Code. Open VS Code, go to the Extensions view by clicking on the square icon in the sidebar or pressing `Ctrl+Shift+X`, and search for "C/C++". Install the one provided by Microsoft.
3. **GCC Compiler**: You need a C compiler to build and run your C programs. Most commonly used is the GNU Compiler Collection (GCC). If you don't have it installed, you can follow instructions here: [Install GCC on Windows, macOS, and Linux](https://gcc.gnu.org/install/index.html).
## Getting Started
1. **Clone the Repository**: Start by cloning the "C-program" repository to your local machine using either the HTTPS or SSH link provided on the repository page.
```sh
git clone
```
2. **Open the Repository in VS Code**: Open Visual Studio Code, and from the menu, select `File > Open Folder...` Navigate to the directory where you cloned the repository and select the folder.
3. **Create or Open a C File**: Inside the repository folder, you can either create a new C file (e.g., `my_program.c`) or open an existing one.
4. **Write Your C Code**: Write your C program in the opened file. For example:
```c
#include
int main() {
printf("Hello, World!\n");
return 0;
}
```
## Compiling and Running
1. **Compile the C Program**: Open a terminal in Visual Studio Code by going to `Terminal > New Terminal`. In the terminal, navigate to the directory containing your C file and use the following command to compile it:
```sh
gcc my_program.c -o my_program
```
2. **Run the Executable**: After successful compilation, run your program by typing the following command in the terminal:
```sh
./my_program
```
You should see the output of your program in the terminal.
## Debugging (Optional)
Visual Studio Code also supports debugging C programs. To set breakpoints, inspect variables, and step through your code, follow these steps:
1. Set a breakpoint by clicking in the gutter next to the line numbers.
2. Press `F5` or go to `Run > Start Debugging` to launch the debugger.
3. Use the debugging controls in the top menu bar to step through your code and inspect variables.
## Conclusion
You have successfully set up and run C programs in Visual Studio Code using the "C-program" repository. Feel free to explore more advanced features and optimize your development process as you become more familiar with both C programming and Visual Studio Code.
Happy coding!