Pages

Monday, March 31, 2025

Getting started with Functions in C++

 #include <iostream>

using namespace std;

void sayHello() {
    cout << "Hello :)\n";
}

int main() {
    sayHello(); // function call
    return 0;
}



Hmmm interesting....


#include <iostream>
using namespace std;

void sayHello() {
    cout << "Hello :) \n";
}

void assistant() {
    sayHello();
    cout << "work done \n";
}


int main() {
    assistant();
    return 0;
}

No comments:

Post a Comment

3917. Count Indices With Opposite Parity (Brute Force) O(n2) + Optimized Solution O(n) + tips LEETCODE WEEKLY 500

  class Solution {     public int [] countOppositeParity ( int [] nums ) {          // approach 1 - checks every pair         int n = n...