Horje
Write a c program to add two numbers without using addition operator. Code Example
Write a c program to add two numbers without using addition operator.
#include <stdio.h>
#include <stdlib.h>
int main()
{
    int num1,num2,i;  //Variable declaration
    printf("Enter the first number: ");
    scanf("%d",&num1); 
    printf("Enter the second number: ");
    scanf("%d",&num2);
    for(i=0; i<num2; i++){
   num1++;
    }
printf("Sum of two numbers : %d ",num1);
    return 0;
}
add two numbers bitwise
public class Bitwise_Addition{
    int add(int a, int b){
        int c;
    while(b!=0){
        c=a&b;
        a=a^b;
        b=c<<1;
        }
    return a;
    }
}
add 2 numbers in c
#include<stdio.h>
int main() {
int a, b, sum;
printf("\nEnter two no: ");
scanf("%d %d", &a, &b);
sum = a + b;
printf("Sum : %d", sum);
return(0);
c program to add two numbers
Enter two integers: 12
11
12 + 11 = 23
C program to addition of two numbers
#include <stdio.h>int main(){ int a, b, sum;printf("Enter two integers");scanf("%d %d", &a, &b);sum = a + b; printf("%d + %d = %d", a, b, sum);return 0;}
Source: inlarn.com




C

Related
how to print something out to the console c Code Example how to print something out to the console c Code Example
remove on condtion in vec rust Code Example remove on condtion in vec rust Code Example
full installation of clang in ubuntu Code Example full installation of clang in ubuntu Code Example
dynamic 2d arr in c Code Example dynamic 2d arr in c Code Example
c get file size Code Example c get file size Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
13