Program to find the double of the given number without using arithmetic operator

Program to find the double of the given number without using arithmetic operator

06 May 2024

06 May 2024

Write a program to find the double of the given number without using arithmetic operator



Description about the Program to find the double of the given number without using arithmetic operator

For the given input number, calculate the double of it without using an arithmetic operator.

 

Input

4

Output

8


C Program to find the double of the given number without using arithmetic operator???????

#include <stdio.h>

int main()

{

    int num;

    printf("Enter a number: ");

    scanf("%d",&num);

    printf("%d",num<<1);

    return 0;

}


C++ Program to find the double of the given number without using arithmetic operator???????

#include <iostream>

using namespace std;

int main()

{

    int  num;

    cout<<"Enter a number: ";

    cin>>num;

    cout<<(num<<1);

    return 0;

}


Java Program to find the double of the given number without using arithmetic operator???????

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

Scanner sc=new Scanner(System.in);

System.out.print("Enter the number: ");

int num = sc.nextInt();

System.out.println(num<<1);

}

}


Python Program to find the double of the given number without using arithmetic operator???????

num=int(input("Enter a number: "))

print(num<<1)



Related Articles

Ask Us Anything !