100+ C programs

⌘K
  1. Home
  2. Docs
  3. 100+ C programs
  4. Basic C programs
  5. Operators

Operators

#include<stdio.h>
int main()
{
printf("Hello world");

return 0;
}
#include <stdio.h>

int main() {
    int num1, num2, sum;

    // Read two numbers from user input
    printf("Enter two numbers:\n");
    scanf("%d%d", &num1, &num2);

    // Perform the addition
    sum = num1 + num2;

    // Display the result
    printf("Sum: %d\n", sum);

    return 0;
}
#include <stdio.h>

int main() {
    int num1, num2, difference;

    // Read two numbers from user input
    printf("Enter two numbers:\n");
    scanf("%d%d", &num1, &num2);

    // Perform the subtraction
    difference = num1 - num2;

    // Display the result
    printf("Difference: %d\n", difference);

    return 0;
}

How can we help?

Leave a Reply

Your email address will not be published. Required fields are marked *