NODjS PROGRAMMING
2.32K subscribers
89 photos
23 files
4 links
Hello! I am @imabhi3030 and welcome to the Coding channel! Here we can learn all things related to coding and improve our skills. I am always present to help you. If you need any kind of assistance, just let me know! 😊
Download Telegram
Program to add two numbers by accepting input from the user:
----------------------------------------------------
Program:

using System;

namespace AddTwoNumbers
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter the first number: ");
int num1 = int.Parse(Console.ReadLine());

Console.WriteLine("Enter the second number: ");
int num2 = int.Parse(Console.ReadLine());

int sum = num1 + num2;

Console.WriteLine("The sum of {0} and {1} is {2}.", num1, num2, sum);
}
}
}

----------------------------------------------------
#basicprograms
here's an example of a TypeScript program that calculates the factorial of a given number:

function factorial(num: number): number {
if (num === 0) {
return 1;
} else {
return num * factorial(num - 1);
}
}

const number = 5 // replace with the number you want to find the factorial of
const result = factorial(number);

console.log(The factorial of ${number} is ${result});
console.log("Hello, world!");

// first js program