Multiply By 2

 Coding Problem Keys 

 Kick Start 

 Multiply By 2 

 Problem Statement 

The program must accept a number and multiply it by 2.

 Example Input/Output 1 

 Input 

10

 Output 

20

 Example Input/Output 2 

 Input 

50

 Output 

100

 Note: Max Execution Time Limit: 4000 millisecs 

 Solution 

 Programming Language: C Language 

#include <stdio.h>
#include <stdlib.h>
int main(){
    int n;
    scanf("%d",&n);
    printf("%d",n*2);
}
//Published By PKJCODERS

 Programming Language: C++ Language 

#include <iostream>
using namespace std;
int main(){
    int n;
    cin>>n;
    cout<<n*2;
}
//Published By PKJCODERS

 Programming Language: Java Language 

import java.util.*;
public class Hello {
    public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.print(n*2);
	}
}
//Published By PKJCODERS

 Programming Language: Python 3 Language 

n=int(input())
print(n*2)
#Published By PKJCODERS

 (Note: Incase If the code doesn't Pass the output kindly comment us with your feedback to help us improvise.) 

Comments

Popular Posts

Intelligent Robber

String Rotation Odd and Even Positions

Both Adjacent Elements - Odd or Even

Octal Equivalent of N

Even Integers - Even Positions

Shortest Path in Tree