Computer Science, asked by srathnamala04, 4 months ago

write an algorithm to double a number in two different ways 1. n + n 2. 2 × n​

Answers

Answered by nranjeet4ne
3

Answer: In C++,

1. n+n,

#include <bits/stdc++.h>

using namespace std;

int main(){

int n;

cin>>n;

int a = n+n;

cout<<a;

return 0;

}

2. 2*n,

Just replace "int a = n+n" with "int a = 2*n" in the above code.

Answered by sahilbasfore111098
4

Answer:

please follow me didi ji please plz plz I have a humble request to you plz and make brainliest me please plz plz

Similar questions