S

@Sarthak_CSE

Relational Operator in C++

C++
3 years ago
#include <iostream> using namespace std; int main() { int x,y; cout<<"##### THE 0 OUTPUT SHOWS THE RESULT IS FALSE AND THE 1 SHOW THE RESULT IS TRUE ##### "<<endl; cout<<"Enter the value of x and y: "<<endl; cin>>x>>y; cout<<"The Value of X is "<<x<<" And the Value of Y is "<<y<<endl; cout<<"the operation X<Y is "<<(x<y)<<endl;

Arithmetic Operator in C++

C++
3 years ago
#include<iostream> using namespace std; int main() /*{ int a,b; cout<<"Enter The Value of A and B : "<<endl; cin>>a>>b; cout<<"The addition is : "<<a+b<<endl; cout<<"The subtraction is : "<<a-b<<endl; cout<<"The multiplication is : "<<a*b<<endl;

input output in c++

C++
3 years ago
#include<iostream> using namespace std; int main() /*{ char name[50]; int age; cout<<"enter the name and the age as well:"<<endl; cin>>name>>age; cout<<"the users name is "<<name<<" and the entered age is:"<<age<<endl; return 0;

char and wide char data type

C++
3 years ago
/*#include<iostream> using namespace std; int main() { char ch='a'; cout<<(int)ch<<endl; return 0; }*/ #include<iostream> using namespace std;

Float data type with set precision format

C++
3 years ago
#include<iostream> #include<iomanip> using namespace std; int main() { float x=4548.546f; double a=9.123456789; long double aa=999.12345678l; cout<<setprecision(6); cout<<"double a:"<<a<<endl;

Float Data Type

C++
3 years ago
#include<iostream> using namespace std; int main() { float x=546.123f; double a=9.123456789; long double aa=999.12345678l; cout<<"double a="<<a<<endl; cout<<"long double aa="<<aa<<endl; cout<<"float x="<<x<<endl;

INT Data Type

C++
3 years ago
#include <iostream> using namespace std; int main() { unsigned short unshort_int=56; signed short signed_short=-6; int a=9916543; long int long_int=456971; long long int ll_int=9914173314;

c++

C++
3 years ago
#include<iostream> #define PI 3.1415 int r=2; void area(); class MyClass { public: int a; void display()

constant variable

C++
3 years ago
#include<iostream> using std::cout; using std::endl; using std::cin; int main() { const int a=32; cout<<a<<endl; a=45; cout<<a<<endl;

Basic

C++
3 years ago
#include<iostream> int main() { std::cout<<"sarthak"<<std:: endl; return 0; }

Singly Linked list

C
3 years ago
#include <stdio.h> #include<stdlib.h> void main() { struct node { int data; struct node*next; }; struct node*head,*newnode,*temp;

Factorial of number by non recursive function

C
3 years ago
#include <stdio.h> int factorial(int n); int main() { int num, fact; printf("Enter a positive integer: "); scanf("%d", &num);

Array basics

C
3 years ago
#include <stdio.h> int main() { int a[50],i,size,num,pos; printf("enter the sie of array: "); scanf("%d",&size); /* ------------------insertion---------------------*/ printf("\nenter the elements of array:");

circular queue by LL

C
3 years ago
#include <stdio.h> #include<stdlib.h> struct node { int data; struct node*next; }; struct node*front=0; struct node*rear=0; void enqueue(int x)

Stack by LL

C
3 years ago
#include<stdio.h> #include<stdlib.h> struct node { int data; struct node*next; }; struct node*top=0; void push(int x) {

Stack by array

C
3 years ago
#include <stdio.h> #define N 5 int stack[N]; int top=-1; void push() { int x; printf("enter the data: "); scanf("%d",&x); if(top=N-1)

Queue by LL

C
3 years ago
#include <stdio.h> #include<stdlib.h> struct node { int data; struct node*next; }; struct node*front=0; struct node*rear=0; void enqueue(int x)

Queue

C
3 years ago
#include <stdio.h> #define N 5 int queue[N]; int front=-1; int rear=-1; void enqueue(int x) { if (rear==N-1) { printf("the queue is empty");