Skip to main content

Small Projects For Beginners - C Language

 In here I will show you some small projects for beginners.


1. Calculator

2. To-Do List

3. Guess the Number Game

4. Bank Management System

5. Student Grade Calculator

6. Simple File Encryption/Decryption

7. Library Management System

8. Temperature Converter


These projects I have done with dev C++ .

A) Create a Calculator

  • Create a basic calculator program that can perform arithmetic operations like addition, subtraction, multiplication, and division.
  • Allow the user to input two numbers and choose the operation.
  • Display the result.

       

       


#include <stdio.h>
int main() {
    int num1, num2;
    char operator;

    printf("Enter first number: ");
    scanf("%d", &num1);

    printf("Enter operator (+, -, *, /): ");
    scanf(" %c", &operator);

    printf("Enter second number: ");
    scanf("%d", &num2);

    switch (operator) {
        case '+':
            printf("Result: %d\n", num1 + num2);
            break;
        case '-':
            printf("Result: %d\n", num1 - num2);
            break;
        case '*':
            printf("Result: %d\n", num1 * num2);
            break;
        case '/':
            if (num2 != 0) {
                printf("Result: %.2f\n", (float)num1 / num2);
            } else {
                printf("Error: Division by zero.\n");
            }
            break;
        default:
            printf("Error: Invalid operator.\n");
    }

    return 0;
}

b) Create a Temperature Converter

  • Develop a program that converts temperatures between Fahrenheit and Celsius.
  • Allow users to input a temperature and choose the conversion direction.
  • Display the converted temperature.




#include <stdio.h>

int main() {
    // Declare variables
    float temperature;
    char choice;

    // Display menu and get user choice
    printf("Temperature Converter\n");
    printf("1. Fahrenheit to Celsius\n");
    printf("2. Celsius to Fahrenheit\n");
    printf("Enter your choice (1 or 2): ");
    scanf(" %c", &choice);

    // Get temperature from user
    printf("Enter temperature: ");
    scanf("%f", &temperature);

    // Perform temperature conversion based on user choice
    switch (choice) {
        case '1':
            // Fahrenheit to Celsius conversion
            temperature = (temperature - 32) * 5 / 9;
            printf("Temperature in Celsius: %.2f\n", temperature);
            break;
        case '2':
            // Celsius to Fahrenheit conversion
            temperature = (temperature * 9 / 5) + 32;
            printf("Temperature in Fahrenheit: %.2f\n", temperature);
            break;
        default:
            // Invalid choice
            printf("Invalid choice. Please enter 1 or 2.\n");
    }

    return 0;
}




Comments

Popular posts from this blog

Jumpstart Your Career: Become a Frontend Developer in One Month

1. Understanding the Basics (Days 1-5):    - HTML: Learn the structure of web pages.    - CSS: Understand styling and layout techniques.    - JavaScript: Introduction to scripting for interactivity. 2. Building Your Skills (Days 6-15):    - Responsive Design: Learn to create websites that work on all devices.    - Version Control: Get familiar with Git and GitHub for collaborative work.    - Frontend Frameworks: Explore popular libraries like Bootstrap or frameworks like React or Vue.js. 3. Putting Theory into Practice (Days 16-25):    - Projects: Work on small projects to apply what you've learned.    - Portfolio Development: Build a portfolio showcasing your projects and skills.    - Code Reviews: Get feedback from peers or mentors to improve your code quality. 4. Diving Deeper (Days 26-30):    - Advanced CSS: Explore animations, transitions, and preprocessors like Sass.    - ...

6G networks explained: Everything you need to know

Just as the 5G juggernaut rolls on across the world, the comms industry is actually gearing up for – and exploring the potential opportunities from – the next generation of wireless: 6G. Since the onset of the transformational 3G mobile standard in 2001, the world of communications became used to the arrival of a new generation in mobile networking every decade. Each new-generation wireless has been designed to provide substantially higher capacity and much lower latency than its predecessor, bringing in a new range of applications and use cases that were not previously supported. 6G will be no exception. Work to create future 6G network specifications is already being planned by standards body 3GPP, with initial 6G networks built on the foundations of 5G . 6G networks are expected to run in the very high GHz and 1THz frequency bands, offering throughput speeds of well over 10 Gbps through up to three 160 MHz channels leading to potential micro-second latencies. Why is 6G necess...

Choosing Your First Programming Language: A Simple Guide

Embarking on your programming journey can be both exciting and overwhelming, especially when faced with the multitude of programming languages available. Selecting the right language for your first steps is crucial to setting a solid foundation. Here's a simple guide to help you navigate this decision-making process . 1.Define Your Goals and Interests Before diving into the array of programming languages, consider your goals and interests. Are you interested in web development, data science, game development, or something else? Different languages are tailored to specific domains, so aligning your choice with your aspirations is key. 2. Ease of Learning For beginners, languages with clear syntax and simple concepts can make the learning curve more manageable. Python, for instance, is known for its readability and simplicity, making it a popular choice for those new to programming. 3. Versatility Opting for a versatile language can broaden your opportunities. Python, JavaScript, and...