C & C++ PROGRAMMING
Открыть в Telegram
https://t.me/addlist/oJIs6WVKrqBmMWQ1 Hello! I am @Myhurthearts and welcome to the Coding channel! Here we can learn all things related to coding and improve our skills , just let me know!
БольшеНет данных
Подписчики
Нет данных24 часа
+337 дней
+17130 день
Архив постов
Join for all programming language more than 30+ channel you must join here useful channel like programming, hacking, notes everything 😁
👉 https://t.me/addlist/5MDFVZjV1Yo2NWI1
Try our new bot @imabhiAI_bot for coding compiler just reply the coding then get output
𝐍ᴀᴅᴀɴ 𝐏ᴀʀɪɴᴅᴇ:
𝗥𝗲𝗮𝗹𝘁𝗶𝗺𝗲 𝗶/𝗼 𝗰𝗼𝗺𝗽𝗶𝗹𝗲𝗿 𝗯𝗼𝘁
=========================
Compilation commands
=========================
/code or /cc for c
/py or /python
/js or /node
/cpp or /cplus
/jv or /java
/go for golang
/ts or /type for typescript
/sql for sql
Wait for update for more info @imabhi3030
// defined cconstant: calculate circumferenxe
#include<iostream>
using namespace std;
#define NEWLINE '\n'
#define PI 3.414159
int main (){
double r=5;
double circle;
circle = 2*PI*r;
cout<<circle;
cout<<NEWLINE;
return 0;
}`Join for all programming language more than 30+ channel you must join here useful channel like programming, hacking, notes everything 😁```
👉 https://t.me/addlist/5MDFVZjV1Yo2NWI1//My first string
#include<iostream>
#include<string>
using namespace std;
int main (){
string myString = "how are you coders .";
cout<<myString<<endl;
myString = "nadan parinde name to suna hi hoga 😂.";
cout<<myString<<endl;
return 0;
}//initialization of variables
#include<iostream>
using namespace std;
int main (){
int a =6;
int b(4);
int result;
a=a+4;
result=a-b;
cout<<"the result is "<<result<<endl;
return 0;
}🔰 join ᴏᴜʀ ᴀʟʟ ᴄʜᴀɴɴᴇʟs for coding 🔰
ᴛᴇʀᴍᴜx ʜᴀᴄᴋɪɴɢ ᴄʟɪᴄᴋ ʜᴇʀᴇ
ᴛᴇʀᴍᴜx ᴄᴏᴍᴍᴀɴᴅ ᴄʟɪᴄᴋ ʜᴇʀᴇ
ᴛᴇʀᴍᴜx ᴛʀɪᴄᴋs ᴄʟɪᴄᴋ ʜᴇʀᴇ
ᴘʜᴘ ʟᴀɴɢᴜᴀɢᴇs ᴄʟɪᴄᴋ ʜᴇʀᴇ
ᴄ ᴘʀᴏɢʀᴀᴍᴍɪɴɢ ᴄʟɪᴄᴋ ʜᴇʀᴇ
ᴄ++ ʟᴀɴɢᴜᴀɢᴇ ᴄʟɪᴄᴋ ʜᴇʀᴇ
ᴄ# ʟᴀɴɢᴜᴀɢᴇ ᴄʟɪᴄᴋ ʜᴇʀᴇ
ᴊᴀᴠᴀ ʟᴀɴɢᴜᴀɢᴇ ᴄʟɪᴄᴋ ʜᴇʀᴇ
ᴄss ʟᴀɴɢᴜᴀɢᴇ ᴄʟɪᴄᴋ ʜᴇʀᴇ
ᴘʏᴛʜᴏɴ ʟᴀɴɢᴜᴀɢᴇ ᴄʟɪᴄᴋ ʜᴇʀᴇ
ᴛʏᴘᴇsᴄʀɪᴘᴛ ᴄʟɪᴄᴋ ʜᴇʀᴇ
ᴊᴀᴠᴀsᴄʀɪᴘᴛ ᴄʟɪᴄᴋ ʜᴇʀᴇ
ʜᴛᴍʟ ʟᴀɴɢᴜᴀɢᴇ ᴄʟɪᴄᴋ ʜᴇʀᴇ
//Factorial of Numbers in C++
#include<iostream>
using namespace std;
int fact(int n){
if(n<=1){
return 1;
}
return n * fact(n-1);
}
int main(){
int a;
cout<<"Enter your no. ";
cin>>a;
cout<<"factorial no. of "<<a<<" is "<<fact(a);
return 0;
}// Swastik pattern
#include<iostream>
using namespace std;
int main() {
int n;
cout << "Enter Number: ";
cin >> n;
for(int k = 1; k <= n * 2 - 1; k++) {
for(int l = 1; l <= n * 2 - 1; l++) {
if(k == n || l == n || k == 1 && l >= n || k <= n && l == 1 || k >= n && l == n * 2 - 1 || k == n * 2 - 1 && l <= n)
cout << " *";
else
cout << " ";
}
cout << endl;
}
return 0;
}//Factorial of Numbers in C++
#include<iostream>
using namespace std;
int fact(int n){
if(n<=1){
return 1;
}
return n * fact(n-1);
}
int main(){
int a;
cout<<"Enter your no. ";
cin>>a;
cout<<"factorial no. of "<<a<<" is "<<fact(a);
return 0;
}Subscribe our channel for termux hacking,python animation,coding,html ,telegram bot tips & trick related - 👉 https://youtube.com/@CODEBOMBS Subscribe our channel for termux hacking, designing, tips & trick, bot making related - 👉 https://youtube.com/@TECHINDNN
Kya abhi bhi Google pe hi search krte ho 😒
Smart bniye use kijiye hmara Chatgpt telegram bot
👉 @imabhiAI_bot
✅ unlimited message
✅ 24×7 Support
✅ support all languages
✅ translation features
✅ quick response
✅ easy to use
Our other bot you can try
Compiler bot advance - @IOCompiler_bot
Code compiler - @Cmpbbot
Compiler pro - @CodeCompiler_Bot
Solve maths - @mathsrobot
Group/channel manage -
@Myhurthearts_bot
C++ programming language
calculator program free source code:
#include <iostream>
using namespace std;
int main()
{
int a,b;
char c;
cout<<"Enter first number : ";
cin>>a;
cout<<"Enter operation number : ";
cin>>c;
cout<<"Enter second number : ";
cin>>b;
switch(c)
{
case '+':
cout<<"Result : "<<a+b;
break;
case '-':
cout<<"Result : "<<a-b;
break;
case '*':
cout<<"Result : "<<a*b;
break;
case '%':
cout<<"Result : "<<a%b;
break;
case '/':
cout<<"Result : "<<a/b;
break;
default:
cout<<"Unable to perform ";
}
return 0;
}
Here's an implementation of the factorial function in C++ using a recursive approach:
#include <iostream>
// Function to calculate factorial recursively
int factorial(int n) {
if (n == 0 || n == 1) {
return 1;
} else {
return n * factorial(n-1);
}
}
// Main function
int main() {
int n;
std::cout << "Enter a number: ";
std::cin >> n;
std::cout << "Factorial of " << n << " is " << factorial(n) << std::endl;
return 0;
}
Program to add two numbers by accepting input from the user:
----------------------------------------------------
Program:
#include <iostream>
using namespace std;
int main()
{
int num1, num2, sum;
// Ask user to input two numbers
cout << "Enter two numbers: ";
cin >> num1 >> num2;
// Add two numbers
sum = num1 + num2;
// Display the result
cout << "Sum = " << sum << endl;
return 0;
}
----------------------------------------------------
#basicprograms
Program to add two numbers
-------------------------------------------------
Program:
#include <iostream>
int main() {
double num1, num2, sum;
// Input
std::cout << "Enter first number: ";
std::cin >> num1;
std::cout << "Enter second number: ";
std::cin >> num2;
// Addition
sum = num1 + num2;
// Display the result
std::cout << "Sum: " << sum << std::endl;
return 0;
}
-------------------------------------------------
#basicprograms