Tuesday, 6 April 2021

Pointer in C and C++ Qus 2

 

#include<stdio.h>

#include<iostream.h>

#include<conio.h>

main()

{

clrscr();

int a=5,b=10;

int *p;

*p=b;

cout<<&a<<endl;

cout<<&b<<endl;

cout<<p<<endl;

cout<<*p<<endl;

cout<<a<<endl;

cout<<b<<endl;

getch();

return 0;

}


Pointer in C and C++ Qus 1

 #include<stdio.h>

#include<iostream.h>

#include<conio.h>

main()

{

clrscr();

int a=5;

int* p=&a;

cout<<a<<endl;

cout<<p<<endl;  //fff4

cout<<&a<<endl;

cout<<*p<<endl;  //5

cout<<p+1<<endl;   //fff6

cout<<*p+1<<endl;   //6

getch();

return 0;

}

Monday, 5 April 2021

2D Array in C++

 #include<stdio.h>

#include<iostream.h>

#include<conio.h>

main()

{

clrscr();

int A[3][3];//={{1,2,3},{4,5,6},{7,8,9}};

int i,j;

cout<<"Enter 9 numbers\n";


for(i=0;i<=2;i++)

{

for(j=0;j<=2;j++)

{

cin>>A[i][j];

}

}

cout<<"Array is\n";

for(i=0;i<=2;i++)

{

for(j=0;j<=2;j++)

{

cout<<A[i][j]<<"\t";

}

cout<<endl;

}

getch();

return 0;

}

Saturday, 3 April 2021

Array in C++

 #include<stdio.h>

#include<iostream.h>

#include<conio.h>

main()

{

clrscr();

int A[5]={5,8,6,9,2};

int i;

for(i=0;i<5;i++)

{

cout<<A[i]<<endl;

}

cout<<"Base Address="<<A<<endl;

for(i=0;i<5;i++)

{

cout<<&A[i]<<endl;

}

getch();

return 0;

}

Friday, 2 April 2021

Pattern in C++

 #include<stdio.h>

#include<iostream.h>

#include<conio.h>

main()

{

clrscr();

/*int i, j;

for(i=1;i<=5;i++)

{

for(j=1;j<=i;j++)

{

cout<<j;

}

cout<<endl;

} */


int i=65,x=1,m=70,j,s=2;

while(x<=7)

{

while(i<=m)

{

cout<<(char)i;

//printf("%c",i);

i++;

}

i=i-1;

if(x!=1)

{

j=1;

while(j<=s)

{

cout<<" ";

j++;

}

s=s+2;

}

while(i>=65)

{

cout<<(char)i;

i--;

}

cout<<endl;

x++;

i++;

m--;

}

getch();

return 0;

}

while, do-while in c++

 

#include<iostream.h>

#include<conio.h>

#include<stdio.h>

int main()

{

clrscr();

int i=0;

while(i<3)

i++;

cout<<"Hello\n"<<i<<endl;


i=2;

do

{

cout<<"Hi";

}

while(i<2);

cout<<endl;

i=0;

while(++i)

{

cout<<"Delhi"<<i<<endl;

break;

}


cout<<endl;

i=0;

do

{

cout<<"Hello"<<endl;

}

while(i!=0);

getch();

return 0;

}

Friday, 26 March 2021

Increment and Decrement Operator in C++

 

Increment and Decrement With Same (Increment or Decrement )Operator on same variable multiple times in C++

Confusing Increment and Decrement Operations in C/C++, Compiler Dependent Increment and Decrement Operators in C/C++. These Statements outputs on the bases of Turbo C3 Compiler.

For Pre Increment - Initial value + All increment (pre or post) put on the places of all pre increment.

For Post Increment - Initial value + 1 put on the places of all post increment

Note: Same for Decrement

#include<stdio.h>

#include<iostream.h>

#include<conio.h>

int a;

main()

{

clrscr();

int a=5;

//a=a++ + a++;  // 6+6=12

//a=++a + ++a ;   //7 + 7=14

//a=++a + a;    //6 + 6=12

//a=a+ ++a; //6+6=12

//a=a + a++; //5+6=11

//a=a++ + a; //6 +5=11

//a=a++ + a++ + a++;     //6+6+6=18

//a=a++ + a++ +a++ +a++; //6+6+6+6=24

//a=a++ + a++ + a++ + a;     //6+6+6+5=23

//a=++a + ++a + ++a;  //8+8+8=24

//a=++a + ++a + ++a + ++a; //9+9+9+9=36

//a=++a + ++a + ++a + a; //8 +8 +8+8=32

//a=++a + a++; //7 + 6=13

//a=++a + a++ + a++; //8 + 6 + 6=20

//a=++a + a++ + a++ + a++; //9+6+6+6=27

//a=++a + a++ + a++ + ++a;  //9+6+6+9=30

//a= --a + a; //4+4=8

//a=a+ --a; //4+4=8

//a=a++ + --a; //5+4=9

//a=a++ + a--; //5 +5=10

//a=a++ + --a + --a;    // 4+3+3=10

//a=a<6;

int b=2;

a=5 && 6;

a=5>3 && 5<3;

a= b++>3 && b++>2;       //2>3 =0, b=3

cout<<a<<" "<<b;

getch();


}

Difference between DOS and DDOS attack

 

DOS

DDOS

DOS Stands for Denial of service attack.

DDOS Stands for Distributed Denial of service attack.

In Dos attack single system targets the victims system.

In DDos multiple system attacks the victims system..

Victim PC is loaded from the packet of data sent from a single location.

Victim PC is loaded from the packet of data sent from Multiple location.

Dos attack is slower as compared to ddos.

DDos attack is faster than Dos Attack.

Can be blocked easily as only one system is used.

It is difficult to block this attack as multiple devices are sending packets and attacking from multiple locations.

In DOS Attack only single device is used with DOS Attack tools.

In DDos attack Bots are used to attack at the same time.

DOS Attcaks are Easy to trace.

DDOS Attacks are Difficult to trace.

Volume of traffic in Dos attack is less as compared to DDos.

DDoS attacks allow the attacker to send massive volumes of traffic to the victim network.

Types of DOS Attacks are:
1. Buffer overflow attacks
2. Ping of Death or ICMP flood
3. Teardrop Attack

Types of DDOS Attacks are:
1. Volumetric Attacks
2. Fragmentation Attacks
3. Application Layer Attacks


AI, AR, VR, IoT, Blockchain Technology

Artificial Intelligence (AI)

Artificial intelligence (AI) is a branch of computer science concerned with building such a smart machine which is capable of performing task such as human being.

Augmented Reality (AR)

Augmented reality overlays digital content and information onto the physical world — as if they’re actually there with you, in your own space. AR opens up new ways for your devices to be helpful throughout your day by letting you experience digital content in the same way you experience the world.

Virtual Reality (VR)

Virtual reality (VR) is a simulated experience that can be similar to or completely different from the real world. Applications of virtual reality include entertainment (e.g. video games) and education (e.g. medical or military training). Virtual Reality (VR) can bring you anywhere — helping you learn about different places and ideas by experiencing them as if you were actually there.

The Internet of Things (IoT)

The Internet of things (IoT) describes the network of physical objects—“things” or objects—that are embedded with sensors, software, and other technologies or the purpose of connecting and exchanging data with other devices and systems over the Internet. Thermostats, cars, lights, refrigerators, and more appliances can all be connected to the IoT.

Blockchain Technology

Blockchain is a system of recording information in a way that makes it difficult or impossible to change, hack, or cheat the system. A blockchain is a digital record of transactions. The name comes from its structure, in which individual records, called blocks, are linked together in single list, called a chain. For Example, A Bitcoin Block contains information about the Sender, Receiver, number of bitcoins to be transferred. The first block in the chain is called the Genesis block.

Eavesdropping

Eavesdropping is the act of listening to the private conversation or communications of others without their consent in order to gather information. An eavesdropping attack, also known as a sniffing or snooping attack, is a theft of information as it is transmitted over a network by a computer, smartphone, or another connected device.

Sunday, 21 March 2021

Version Control Systems in Software Engineering

 

Version Control Systems

Version control systems are a category of software tools that help a software team manage changes to source code over time. Version control software keeps track of every modification to the code in a special kind of database. If a mistake is made, developers can turn back the clock and compare earlier versions of the code to help fix the mistake.

·        Developing software without using version control is risky, like not having backups.

·        VCS are sometimes known as SCM (Source Code Management) tools or RCS (Revision Control System). One of the most popular VCS tools in use today is called Git. 

·        Git is a Distributed VCS, a category known as DVCS

·        Git is free and open source.

A repository: 

It can be thought as a database of changes. It contains all the edits and historical versions (snapshots) of the project.

Copy of Work (sometimes called as checkout): 

It is the personal copy of all the files in a project. You can edit to this copy, without affecting the work of others and you can finally commit your changes to a repository when you are done making your changes.

Types of Version Control Systems

The three most popular version control systems are broken down into two main categories, centralized and decentralized (also known as distributed).

Centralized Version Control

The main concept of a centralized system is that it works in a client and server relationship. The repository is located in one place and provides access to many clients. It’s very similar to FTP in where you have an FTP client which connects to an FTP server. All changes, users, commit and information must be sent and received from this central repository.

Centralized Version Control Systems: Centralized version control systems contain just one repository and each user gets their own working copy. You need to commit to reflecting your changes in the repository. It is possible for others to see your changes by updating.

Two things are required to make your changes visible to others which are:

·        You commit

·        They update






Example:

·        Vesta

·        Concurrent Versions System

·        Subversion


Distributed Version Control Systems: 

Distributed version control systems contain multiple repositories. Each user has their own repository and working copy. Just committing your changes will not give others access to your changes. This is because commit will reflect those changes in your local repository and you need to push them in order to make them visible on the central repository. Similarly, when you update, you do not get other’s changes unless you have first pulled those changes into your repository.

To make your changes visible to others, 4 things are required:

·        You commit

·        You push

·        They pull

·        They update 




Examples:

·        Git
·        Bazaar 
·        BitKeeper
·      Fossil