C programming
C programming language
Typing discipline: Static, weak, manifest, nominal
Stable release: C18 / June 2018; 2 years ago
Developer: Dennis Ritchie & Bell Labs (creators); ANSI X3J11 (ANSI C); ISO/IEC JTC1/SC22/WG14 (ISO C)
Filename extensions: c,.h
Why the C programming languauge is used.
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
Post a Comment