V

@Vikasnagar

Stack in java

Java
1 year ago
import java.util.Scanner; class Stack { Scanner sc = new Scanner(System.in); int top = -1; int stackSize=3; int[] stack = new int[stackSize];

Traversal of Binary Tree

C
1 year ago
#include <stdio.h> #include <stdlib.h> // Define the structure for a node in the binary tree struct Node { int data; struct Node* left; struct Node* right; };

Queue

C
1 year ago
#include<stdio.h> #include<stdlib.h> #define max 5 int q[max],front=-1,rear=-1; void enqueue(); void dequeue(); void disp(); void main(){ int ch;

stack

C
1 year ago
// Online C compiler to run C program online #include <stdio.h> #include<conio.h> #include<stdlib.h> #define MAX 5 int a[MAX] ,top=-1; void push(); void pop(); void display();

hero

Java
1 year ago
import java.util.*; import java.lang.*; import java.io.*; // The main method must be in a class named "Main". import java.util.Scanner; class areacircle { public static void main (string args[]) {

grade

Bash
1 year ago
#!/bin/bash echo "Hello world!" read a if [[($a -ge "80") && ($a -lt "90")]] then echo "good" fi

copy constructor in cpp

C++
2 years ago
#include <iostream> using namespace std; class additon { public: int a,b; additon(int x,int y){ a=x; b=y; } additon(additon &obj){

Constructorb & deconstructor in cpp

C++
2 years ago
#include <iostream> using namespace std; class MyName{ public: string name2; MyName ( ){

unixc

Bash
2 years ago
#!/bin/bash echo "Hello world!" echo "Enter first number:" read a echo "Enter second number:" read b sum=$((a + b))

cpp

C++
2 years ago
#include <iostream> int main() { int radius ; using namespace std; cout<<"enter radius\n"; cin>>radius; cout<<"area of circle is = "; cout<<3*radius*radius; return 0;

c

C
2 years ago
#include <stdio.h> int main() { float radius; printf("Enter Radius of circle\n"); scanf("%f",&radius); printf("Area of circle is ="); printf("%f",3.14f*radius*radius);

functions in cpp

C++
2 years ago
#include <iostream> using namespace std; // class Patterns { // void square (){ // for (int i=0; i<5; i++){ // cout<<"__"; // }

area circle

C++
2 years ago
#include <iostream> using namespace std; class Area { public: void Circle (int radius) { float result = 3.14*radius*radius; cout <<"area of circle is "<<result<<endl; }

reference var or Address in cpp

C++
2 years ago
#include <iostream> using namespace std; int main() { int a = 45; int *b = &a ; std::cout << b<< std::endl; return 0; }

Default argument in cpp

C++
2 years ago
#include <iostream> using namespace std; void myAge(string name, int age=18) // we set default value { cout <<name<<"age is "<<age<<endl; }

Classes in cpp

C++
2 years ago
#include <iostream> using namespace std; //we create a new class class student { public: string n; //getter setter like java // we create a methods

functions in cpp

C++
2 years ago
#include <iostream> using namespace std; // we creating a function void printMyName(){ cout<<"Vikas"<<endl; } // 2nd function we create for subtract

Inline and macro function in cpp

C++
2 years ago
#include <iostream> using namespace std; //this is macro we define already vikasage #define Vikasage 19; // jab bhi vikas age use krenge 19 print hoga int add(int x, int y){ return (x+y) ; }

c++ basics

C++
2 years ago
#include <iostream> using namespace std; int main() { int a = 5; int b = 7; int result = a+b; cout << (result); cout <<a+b;

first cpp program

C++
2 years ago
#include <iostream> using namespace std; class student { public: string n; float result; void setName(string name){ n = name; }