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

remove duplicates from sorted array - two pointer approach (leetcode)

  class Solution {     public int removeDuplicates ( int [] nums ) {         // base case: return if array have no el.         if ( nums...