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

Stack using Linked List – Partial (University Exam Topic)

 #include <iostream> using namespace std; struct Node {     int data;     Node* next; }; class Stack {     Node* top; public:     Stac...