Search
 
SCRIPT & CODE EXAMPLE
 

C

addition in c

/*Program for adding two numbers*/
#include <stdio.h>
int main(){
	int a, b, sum; //declare the variables that will be used, a will store the first number, b second number and sum, the sum.
    printf("Enter the first number: 
"); //Prompts user to enter the first number.
    scanf("%d", &a);//Accepts input and saves it to variable a
    printf("Enter the second number: 
");
    scanf("%d", &b);
    sum = a + b; //Formular to add the two numbers.
    printf("Sum is %d", sum);
}
Comment

addition.c

#include<conio.h>
#include<stdio.h>
{
int a,b;
a=2;
b=10;
a=a+b;
printf("%d",&a);
getch();
}
Comment

c addition

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

int main()
{
	int a,b,sum;
	sum=a+b;
	
	printf("
 enter the first number %d:");
	printf("
 enter the second number %d:");
	scanf("%d",&a,&b)
	printf("%d",sum);
}
Comment

PREVIOUS NEXT
Code Example
C :: count distinct characters in a string C 
C :: format specifiers in c 
C :: multiplication table in c 
C :: celsius to fahrenheit formula 
C :: malloc c include 
C :: enum in c 
C :: grepper vscodium 
C :: star pattern in c 
C :: convert c program to assembly language online 
C :: volatile keyword in c 
C :: c loop 
C :: unable to locate package dos2unix 
C :: c bubble sort 
C :: malloc 
C :: what is c 
C :: recursive in c 
C :: eliminare file in c 
C :: choose random number with weight 
C :: user define function in c 
C :: notation of positive in c 
C :: nested while loop in c 
C :: check command line input is a number in c 
C :: man strstr 
C :: lxde automatic login 
C :: float da 4 byte 
C :: router solicitation and advertisement magic is used by 
C :: best graphic video template for editing free download 
C :: error: invalid type for iteration variable ‘i’ #pragma omp parallel for 
C :: georgia institute of technology 
C :: UTC offset upper limit 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =