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

The Profound Power of Silence , Understanding and Embracing Introverted Individuals

  In a international that frequently celebrates the artwork of communique and extroverted qualities, the quiet power of introverted people has a tendency to be disregarded. Silence, regularly misunderstood, is a powerful issue of human conversation that consists of a completely unique richness. In this text, we discover the psychology at the back of silent individuals, analyzing the depths in their mind, emotions, and the precious contributions they bring to our social tapestry. The Nature of Silence: Silence, for plenty introverted people, isn't simply the absence of words however a deliberate desire to engage with the sector in a specific manner. It is a space where mind are cautiously crafted, feelings are processed, and a deeper information of the self unfolds. Introverts frequently find solace in silence, using it as a tool for introspection and self-discovery. 1. The Strength in Reflection Silent people are regularly deep thinkers who thrive in contemplation. Silence afford...

The Transformative Power of Reading : How Books Contribute to Personal Success

In a quick-paced world filled with digital distractions, the simple act of analyzing books holds profound implications for shaping and improving one's personality. Beyond the acquisition of expertise, delving into the geographical regions of literature contributes substantially to personal success. This article explores the numerous approaches wherein studying books can definitely impact and refine an individual's personality, ultimately paving the manner for achievement. 1. Cognitive Stimulation and Critical Thinking     Reading stimulates the brain, enhancing cognitive capabilities and fostering essential questioning capabilities. Engaging with diverse narratives and complex ideas expands mental horizons, allowing people to approach demanding situations with a more analytical and creative attitude. This mental agility is a key attribute in navigating the complexities of personal and expert lifestyles. 2. Empathy and Emotional Intelligence    Literature, with its po...

Artificial Intelligence (AI): Transforming the Landscape of Innovation

Artificial Intelligence (AI): " Transforming the Landscape of Innovation". In the unexpectedly evolving world of generation, Artificial Intelligence (AI) stands as a beacon of transformative power. From revolutionizing industries to reshaping every day life, AI is at the leading edge of innovation. This article delves into the important thing sides of AI, exploring its contemporary nation, ability applications, moral issues, and the consequences for the future. Understanding AI: At its middle, AI refers back to the improvement of computer structures which can perform duties that normally require human intelligence. This contains a extensive variety of capabilities, from hassle-solving and studying to herbal language processing and belief. Machine Learning (ML), a subset of AI, permits structures to enhance overall performance primarily based on enjoy, similarly amplifying their adaptability. Current Applications: AI has already woven itself into the material of diverse...