fa
Feedback
C & C++ PROGRAMMING

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 روز
آرشیو پست ها
🌟 Unlock Your Career in C++ & DSA! 🌟 Are you ready to dive into the world of programming? 💻✨ We have the *ultimate* collection of C++ and DSA courses that can set you on the path to success! 🚀 🔵 C++ & C++ with DSA Masterclass 💡 ALPHA DSA C++ - Stand Out in the Crowd! 🚀 PW C++ DSA - Propel Your Skills! 🔥 Love Babbar Supreme Batch - Learn from the Best! 📘 DSA by Abdul Bari - Expert Guidance!NARESH IT DSA - Proven Techniques! 😱 Durgasoft DSA - Grab Your Opportunity! 🤡 Ashok IT - Fun and Engaging Learning!Exclusive Offer: Get Access for Only ₹100! ✨ Originally valued at ₹10,000, this is your chance to grab it at an unbelievable 1% of the price! 💰 Don’t miss out on this incredible opportunity to enhance your skills and boost your career! 🙌 💬 Message us now at: @Myhurthearts @imabhi3030 🌈 Invest in your future today! 🌈

Program : Write a function to find maximum of two numbers.
#include <iostream>

using namespace std;
int findMax(int n1 , int n2){
    if(n1 > n2){
        return n1;
    }
    return n2;
}

int main() {
     int num1,num2;
     cout << "Enter any two different numbers:"<<endl;
     cin >> num1 >> num2;
     int max = findMax(num1,num2);
     cout << "Maximum of "<< num1 << " and " << num2 << " is " << max;
     return 0;
}

Program : Write a function to find maximum of two numbers.
#include <iostream>

using namespace std;
int findMax(int n1 , int n2){
    if(n1 > n2){
        return n1;
    }
    return n2;
}

int main() {
     int num1,num2;
     cout << "Enter any two different numbers:"<<endl;
     cin >> num1 >> num2;
     int max = findMax(num1,num2);
     cout << "Maximum of "<< num1 << " and " << num2 << " is " << max;
     return 0;
}

Program : Sum on n natural numbers using do while loop.
#include <iostream>

using namespace std;

int main() {
    int n,sum=0,i=1;
    cout << "Enter the value of n:";
    cin >> n;
    do{
        sum = sum + i;
        i++;
    }while(i <= n);
    cout << "Sum of "<< n << " natural numbers :" << sum;
}

🌟 Unlock Your Career in C++ & DSA! 🌟 Are you ready to dive into the world of programming? 💻✨ We have the *ultimate* collection of C++ and DSA courses that can set you on the path to success! 🚀 🔵 C++ & C++ with DSA Masterclass 💡 ALPHA DSA C++ - Stand Out in the Crowd! 🚀 PW C++ DSA - Propel Your Skills! 🔥 Love Babbar Supreme Batch - Learn from the Best! 📘 DSA by Abdul Bari - Expert Guidance!NARESH IT DSA - Proven Techniques! 😱 Durgasoft DSA - Grab Your Opportunity! 🤡 Ashok IT - Fun and Engaging Learning!Exclusive Offer: Get Access for Only ₹100! ✨ Originally valued at ₹10,000, this is your chance to grab it at an unbelievable 1% of the price! 💰 Don’t miss out on this incredible opportunity to enhance your skills and boost your career! 🙌 💬 Message us now at: @Myhurthearts @imabhi3030 🌈 Invest in your future today! 🌈

Program : Design a number guessing game using while loop. Take range of numbers from 1 - 10 hard code any number between 1 and 10 Ask user to guess the number after guessing display number of attempts made to guess the number.
cpp
#include <iostream>

using namespace std;

int main()
{
    int numberToGuess = 4;
    int attempts = 0;
    int guess = 0;
    while (guess != numberToGuess)
    {
        cout << "Guess the number between 1 and 10:" << endl;
        cin >> guess;
        attempts++;
        if(guess == numberToGuess){
            cout << "You guessed it right in " << attempts << " attempts" << endl;
        }
    }
    cout << "Game ended";
    return 0;
}

Program : Design a number guessing game using while loop. Take range of numbers from 1 - 10 hard code any number between 1 and 10 Ask user to guess the number after guessing display number of attempts made to guess the number.
cpp
#include <iostream>

using namespace std;

int main()
{
    int numberToGuess = 4;
    int attempts = 0;
    int guess = 0;
    while (guess != numberToGuess)
    {
        cout << "Guess the number between 1 and 10:" << endl;
        cin >> guess;
        attempts++;
        if(guess == numberToGuess){
            cout << "You guessed it right in " << attempts << " attempts" << endl;
        }
    }
    cout << "Game ended";
    return 0;
}

Program: Given an array with numbers 11,12,13,14,15 calculate the sum of elements in array using range based for loop.
cpp
#include <iostream>

using namespace std;

int main(){
    int numbers[] = {11,12,13,14,15};
    int sum = 0;
    for(int number : numbers){
        sum = sum + number;
    }
    cout << "Sum = "<< sum;
    return 0;
}

Program : To calculate factorial of a given number
cpp
#include <iostream>

using namespace std;

int main() {
    int num,res=1;
    cout << "Enter a positive number:" << endl;
    cin >> num;
    if(num < 0){
        cout << "You entered a negative number" << endl;
    }
    else if(num == 0){
        cout << "0! = " << "1";
    }
    else{
        for(int i = 1;i <= num;i++){
            res = res * i;
        }
        cout << "Factorial of " << num << " is "<<res;
    }

    return 0;
}

Program to convert temperature from Fahrenheit to Celsius.
#include <iostream>
using namespace std;
int main() {
    double fahrenheitTemperature;
    double temperatureInCelsius;
    cout << "Enter your temperature in Fahrenheit:";
    cin >> fahrenheitTemperature;
    temperatureInCelsius = ((fahrenheitTemperature - 32) * 5) / 9;
    cout << "Temperature in celsius : " << temperatureInCelsius;
    return 0;
}

Program to swap values of two variables.
#include <iostream>

int main() {
    int a=1;
    int b=2;
    int temp;
    std::cout << "Before Swapping:\n";
    std::cout << "a=" << a <<",b=" << b <<"\n";
    temp = a;
    a=b;
    b=temp;
    std::cout << "After Swapping:\n";
    std::cout << "a=" << a <<",b=" << b <<"\n";
    return 0;
}

👆100% Ai ka use krk Music Rap Video bnaya 😁 Plz watch guys and give some response about video 😁

👑 ɴᴀᴍᴇ - 𝐍ᴀᴅᴀɴ 𝐏ᴀʀɪɴᴅᴇ 🤡ᴜꜱᴇʀɴᴀᴍᴇ - @Myhurthearts @imabhi3030 ᴀɢᴇ - 18 +  ❤️ 💣 ғʀᴏᴍ - ɪɴᴅɪᴀ 🇮🇳 ⚜️ꜱᴘᴇᴄɪᴀʟɪᴛɪᴇꜱ... ✅ʜᴀᴄᴋɪɴɢ               ✅ᴇᴅɪᴛɪɴɢ ✅ʟᴏɢᴏ ᴍᴀᴋɪɴɢ ✅ᴛᴇʀᴍᴜx ᴇxᴘᴇʀᴛ ✅ᴄʜᴀɴɴᴇʟ ᴍᴀɴᴇɢᴍᴇɴᴛ ✅ᴛʀɪᴄᴋ ʜᴜɴᴛᴇʀ ✅ᴍɪx ᴛᴀʟᴇɴᴛᴇᴅ ✅ɢʀᴀᴘʜɪᴄ ᴅᴇsɪɢɴᴇʀ ✅ʙᴄᴀ,ᴅɪᴛ,ᴀᴅᴄᴀ,ᴅᴄᴀ ✅ᴅɪɢɪᴛᴀʟ ᴄʀᴇᴀᴛᴇʀ ✅ᴛᴇᴄʜ ʏᴏᴜᴛᴜʙᴇʀ ✅ᴛᴇᴄʜ ʙʟᴏɢɢᴇʀ ✅ᴘʜᴏᴛᴏsʜᴏᴘ ᴇxᴘᴇʀᴛ ✅ᴛᴇʟᴇɢʀᴀᴍ ʙᴏᴛ ᴍᴀᴋᴇʀ ➖➖➖➖➖➖➖➖➖➖➖➖ ɪɴᴛʀᴏᴠᴇʀᴛ | ᴛᴇᴄʜɴᴏᴘʜɪʟᴇ | ᴇᴀɢᴇʀɴᴇꜱꜱ ᴏғ ʟᴇᴀʀɴ | ʟᴇɢᴇɴᴅ ᴍᴇᴍᴍᴇʀ | ғᴜɴɴʏ | ᴘᴏsɪᴛɪᴠɪᴛʏ | ᴛʜɪɴᴋᴇʀ | 80ᴛᴜᴅᴇ | ᴜɴɪǫᴜᴇ | ᴍᴜʟᴛɪ-ᴛᴀʟᴀɴᴛᴇᴅ ➖➖➖➖➖➖➖➖➖➖➖➖   👣 ᴍɪᴅᴅʟᴇ-ᴄʟᴀꜱꜱ ʙᴏʏ ᴡɪᴛʜ ʜᴜɢᴇ ᴅʀᴇᴀᴍ 😊 ➖➖➖➖➖➖➖➖➖➖➖➖                               🔰ᴏᴜʀ ᴀʟʟ ɢʀᴏᴜᴘs🔰 ┎┉┉┅┄┄┈•┉┅┄┄┈•┉┅┄┄┈•┉┅ ┣◈ ‣ ᴄᴏᴅɪɴɢ ɢʀᴏᴜᴘ  ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ ʜᴀᴄᴋɪɴɢ ɢʀᴏᴜᴘ ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ ʟʙsᴛɪ ɢʀᴏᴜᴘ  ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ ʙᴄᴀ ɢʀᴏᴜᴘ   ᴄʟɪᴄᴋ ʜᴇʀᴇ ┖┉┉┅┄┄┈•┄┈•┉┅┄┄┈•┉┅┄┄┈               🔰ʜᴀᴄᴋɪɴɢ ᴄʜᴀɴɴᴇʟs🔰 ┎┉┉┅┄┄┈•┉┅┄┄┈•┉┅┄┄┈•┉┅ ┣◈ ‣ ʜᴀᴄᴋɪɴɢ ᴛᴏᴏʟs ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ ʜᴀᴄᴋɪɴɢ ᴛɪᴘs   ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ ᴛᴇʀᴍᴜx ᴛᴏᴏʟ ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ ʟɪɴᴜx ᴛᴏᴏʟs ᴄʟɪᴄᴋ ʜᴇʀᴇ ┖┉┉┅┄┄┈•┄┈•┉┅┄┄┈•┉┅┄┄┈                 🔰 ᴘʀᴏɢʀᴀᴍᴍɪɴɢs 🔰 ┎┉┉┅┄┄┈•┉┅┄┄┈•┉┅┄┄┈•┉┅ ┣◈ ‣ ᴄ ᴘʀᴏɢʀᴀᴍ   ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ ᴄ++ ᴘʀᴏɢʀᴀᴍ  ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ ᴄ# ᴘʀᴏɢʀᴀᴍ   ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ ᴊᴀᴠᴀ ᴘʀᴏɢʀᴀᴍ  ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ ᴄss ᴘʀᴏɢʀᴀᴍ  ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ ᴘʏᴛʜᴏɴ ᴄᴏᴅᴇ   ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ ᴊᴀᴠᴀsᴄʀɪᴘᴛ   ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ ʜᴛᴍʟ ᴘʀᴏɢʀᴀᴍ ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ ᴘʜᴘ ᴘʀᴏɢʀᴀᴍ  ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ ɴᴏᴅᴇᴊs ᴄᴏᴅɪɴɢ ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ ɢɪᴛʜᴜʙ ᴛᴏᴏʟs  ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ ᴍᴇᴍᴇ ᴢᴏɴᴇ   ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ ғʀᴇᴇ ᴄᴏᴜʀsᴇ   ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ ʜᴀᴄᴋᴇʀ sᴄʀɪᴘᴛ  ᴄʟɪᴄᴋ ʜᴇʀᴇ ┖┉┉┅┄┄┈•┄┈•┉┅┄┄┈•┉┅┄┄┈        🔰ʙᴄᴀ/ᴍᴄᴀ/ʙ.ᴛᴇᴄʜ ɴᴏᴛᴇs🔰 ┎┉┉┅┄┄┈•┉┅┄┄┈•┉┅┄┄┈•┉┅ ┣◈ ‣ 1sᴛ sᴇᴍᴇsᴛᴇʀ   ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ 2ɴᴅ sᴇᴍᴇsᴛᴇʀ  ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ 3ʀᴅ sᴇᴍᴇsᴛᴇʀ  ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ 5ᴛʜ sᴇᴍᴇsᴛᴇʀ  ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ 6ᴛʜ sᴇᴍᴇsᴛᴇʀ  ᴄʟɪᴄᴋ ʜᴇʀᴇ ┖┉┉┅┄┄┈•┄┈•┉┅┄┄┈•┉┅┄┄┈        🔰ғᴜʟʟ ᴘʀᴇᴍɪᴜᴍ ᴄᴏᴜʀsᴇ🔰 ┎┉┉┅┄┄┈•┉┅┄┄┈•┉┅┄┄┈•┉┅ ┣◈ ‣ᴀɪ ғᴜʟʟ ᴄᴏᴜʀsᴇ  ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ᴘʏᴛʜᴏɴ ᴄᴏᴜʀsᴇ ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ʟɪɴᴜx ᴄᴏᴜʀsᴇ   ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ᴊᴀᴠᴀsᴄʀɪᴘᴛ   ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ʀᴇᴀᴄᴛ ᴄᴏᴜʀsᴇ  ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ʜᴀᴄᴋɪɴɢ ғɪʟᴇs   ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ᴍᴏʙɪʟᴇ ᴀᴘᴘs    ᴄʟɪᴄᴋ ʜᴇʀᴇ ┣◈ ‣ᴅᴇʟᴛᴀ ʙᴀᴛᴄʜ  ᴄʟɪᴄᴋ ʜᴇʀᴇ ┖┉┉┅┄┄┈•┄┈•┉┅┄┄┈•┉┅┄┄┈ ┎┉┉┅┄┄┈•┉┅┄┄┈•┉┅┄┄┈•┉┅ Guys we are now on WhatsApp so plz join for daily coding program, tips tricks and updates 😁 ┣◈ ‣ ᴘʏᴛʜᴏɴ ᴄᴏᴅᴇ  🖥 https://whatsapp.com/channel/0029VaUafpT2ZjCrkZGq6L2B ┣◈ ‣ ᴄ ᴘʀᴏɢʀᴀᴍ  🖥 https://whatsapp.com/channel/0029VaTWoqbJUM2Y6jKYPa2F ┣◈ ‣ ᴄ++ ᴘʀᴏɢʀᴀᴍ  🖥 https://whatsapp.com/channel/0029VaTKg5h5PO0uEBUSYr34 ┣◈ ‣ ᴊᴀᴠᴀ ᴘʀᴏɢʀᴀᴍ 🖥 https://whatsapp.com/channel/0029VaTx1yoFi8xVW6fl940b ┣◈ ‣ ᴄss ᴘʀᴏɢʀᴀᴍ 🖥 https://whatsapp.com/channel/0029VaPM0dhJP21CXwxCTs0h ┣◈ ‣ ʜᴛᴍʟ ᴘʀᴏɢʀᴀᴍ 🖥 https://whatsapp.com/channel/0029VaPUlgy1NCrQRGkVPb19 ┣◈ ‣ʜᴀᴄᴋɪɴɢ ᴛᴏᴏʟs 🖥 https://whatsapp.com/channel/0029VaPVogo3AzNIgRlfYm3L ┖┉┉┅┄┄┈•┄┈•┉┅┄┄┈•┉┅┄┄┈ ┣◈PROGRAMMING NOTES🖥 https://whatsapp.com/channel/0029VaOwpzJFnSzBx2t8B10M ┖┉┉┅┄┄┈•┄┈•┉┅┄┄┈•┉┅┄┄┈ ┣◈JAVASCRIPT 🖥 PROGRAMMING https://whatsapp.com/channel/0029VaU2kOBLSmbZgz1D7i3S ┖┉┉┅┄┄┈•┄┈•┉┅┄┄┈•┉┅┄┄┈ Subscribe 😁 - https://youtube.com/@CODEBOMBB

Program to swap values of two variables.
#include <iostream>

int main() {
    int a=1;
    int b=2;
    int temp;
    std::cout << "Before Swapping:\n";
    std::cout << "a=" << a <<",b=" << b <<"\n";
    temp = a;
    a=b;
    b=temp;
    std::cout << "After Swapping:\n";
    std::cout << "a=" << a <<",b=" << b <<"\n";
    return 0;
}

Output of above code?
Anonymous voting

#include <stdio.h>

int main() {
    int x = 10;
    int *ptr = &x;
    *ptr = 20;
    printf("%d\n", x);
    return 0;
}

IND vs PAK 😁 Kaun jitega aaj
Anonymous voting