C programming

                   C programming language




C is a general-purpose, procedural computer programming language supporting structured programming, lexical variable scope, and recursion, with a static type system. By design, C provides constructs that map efficiently to typical machine instructions. Wikipedia
Typing disciplineStatic, weak, manifest, nominal
Stable releaseC18 / June 2018; 2 years ago
DeveloperDennis Ritchie & Bell Labs (creators); ANSI X3J11 (ANSI C); ISO/IEC JTC1/SC22/WG14 (ISO C)

Why the C programming languauge is used.
The C language was actually created to move the UNIX kernel code from assembly to a higher level language, which would do the same tasks with fewer lines of code. ... The GNU operating system itself was started using C and Lisp programming languages, so many of its components are written in C.
How to make a simple addition or subtraction using C.
                               -- Addition Program--
STEP:1 --Write this Code in your editor.
-----------------------👇👇👇👇👇👇👇👇👇---------------------------
#include<stdio.h>

int main()

{
    int a = 89;
    int b = 70;
    int add = a + b;
    printf("additon is %d", add);
}

      -----------------------👆👆👆👆👆👆---------------------------------

STEP:2 - - Compile and Run your program.


                                             ----- Subtraction Program----
STEP:1 Write this code in your  C editor.
-----------------------👇👇👇👇👇👇👇👇👇---------------------------
#include<stdio.h>

int main()

{
    int a = 89;
    int b = 70;
    int sub = a - b;
    printf("substraction is %d", sub);
}

      -----------------------👆👆👆👆👆👆---------------------------------

STEP:2 -- Compile and Run Your Sub program.

 LEARN HOW TO MAKE A CALCULATOR WITH C.
Write this code on your editor.

-----------------------------------------------------------------------------------------------------------------------------------

#include<stdio.h>
#include<conio.h>

main()
{

    float num1;
    float num2;
    char op;
    float result;

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

    printf("Enter the operation:");
   scanf(" %c",&op);

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

   switch(op)
   {

   case '-':
    result = num1-num2;
    printf("%f",result);
    break;

    case '+':
    result = num1+num2;
    printf("%f",result);
    break;

    case '/':
    result = num1/num2;
    printf("%f",result);
    break;

    case '*':
    result = num1*num2;
    printf("%f",result);
    break;

    default :
        printf("the enter value is not valid:");

   }

}
-----------------------------------------------------------------------------------------------------------------------------------------
STEP 2-- Compile and Run.







Comments

Popular posts from this blog

PROJECT 3

Cascading Style Sheets(CSS)

SPEEDTEST PYTHON PROJECT