You are on page 1of 2

NAME:- Vaibhav Diliprao Patil

ROLL NO:- 86

DIVISION:- B

SRN NO:- 202101696

TDSL Lab Assignment 3

Code:-
#include <iostream>

#include <stdexcept>

#include <vector>

int main(void) {

std::vector<int> myvector(10);

try {

myvector.at(11) = 50;

catch (const std::out_of_range& error)

std::cerr << "vector Out of Range error displayed: " << error.what() << '\n';

return 0;

}
Output:-

You might also like