Skip to content

Commit 0c843b0

Browse files
First Commit 👉
0 parents  commit 0c843b0

40 files changed

+1572
-0
lines changed

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/Weapon-For-Interview🥷.iml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.vscode/launch.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "(gdb) Attach",
9+
"type": "cppdbg",
10+
"request": "attach",
11+
"program": "enter program name, for example ${workspaceFolder}/a.exe",
12+
"MIMode": "gdb",
13+
"miDebuggerPath": "/path/to/gdb",
14+
"setupCommands": [
15+
{
16+
"description": "Enable pretty-printing for gdb",
17+
"text": "-enable-pretty-printing",
18+
"ignoreFailures": true
19+
},
20+
{
21+
"description": "Set Disassembly Flavor to Intel",
22+
"text": "-gdb-set disassembly-flavor intel",
23+
"ignoreFailures": true
24+
}
25+
]
26+
},
27+
{
28+
"name": "(gdb) Attach",
29+
"type": "cppdbg",
30+
"request": "attach",
31+
"program": "enter program name, for example ${workspaceFolder}/a.exe",
32+
"MIMode": "gdb",
33+
"miDebuggerPath": "/path/to/gdb",
34+
"setupCommands": [
35+
{
36+
"description": "Enable pretty-printing for gdb",
37+
"text": "-enable-pretty-printing",
38+
"ignoreFailures": true
39+
},
40+
{
41+
"description": "Set Disassembly Flavor to Intel",
42+
"text": "-gdb-set disassembly-flavor intel",
43+
"ignoreFailures": true
44+
}
45+
]
46+
}
47+
48+
]
49+
}

.vscode/settings.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"workbench.colorCustomizations": {
3+
"activityBar.activeBackground": "#ff6433",
4+
"activityBar.background": "#ff6433",
5+
"activityBar.foreground": "#15202b",
6+
"activityBar.inactiveForeground": "#15202b99",
7+
"activityBarBadge.background": "#00ff3d",
8+
"activityBarBadge.foreground": "#15202b",
9+
"commandCenter.border": "#e7e7e799",
10+
"sash.hoverBorder": "#ff6433",
11+
"statusBar.background": "#ff3d00",
12+
"statusBar.foreground": "#e7e7e7",
13+
"statusBarItem.hoverBackground": "#ff6433",
14+
"statusBarItem.remoteBackground": "#ff3d00",
15+
"statusBarItem.remoteForeground": "#e7e7e7",
16+
"titleBar.activeBackground": "#ff3d00",
17+
"titleBar.activeForeground": "#e7e7e7",
18+
"titleBar.inactiveBackground": "#ff3d0099",
19+
"titleBar.inactiveForeground": "#e7e7e799"
20+
},
21+
"peacock.color": "#ff3d00",
22+
"files.associations": {
23+
"iostream": "cpp"
24+
}
25+
}

.vscode/tasks.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"tasks": [
3+
{
4+
"type": "cppbuild",
5+
"label": "C/C++: gcc.exe build active file",
6+
"command": "C:\\MinGW\\bin\\gcc.exe",
7+
"args": [
8+
"-fdiagnostics-color=always",
9+
"-g",
10+
"${file}",
11+
"-o",
12+
"${fileDirname}\\${fileBasenameNoExtension}.exe"
13+
],
14+
"options": {
15+
"cwd": "${fileDirname}"
16+
},
17+
"problemMatcher": [
18+
"$gcc"
19+
],
20+
"group": {
21+
"kind": "build",
22+
"isDefault": true
23+
},
24+
"detail": "Task generated by Debugger."
25+
}
26+
],
27+
"version": "2.0.0"
28+
}

Arrays/Basics.cpp

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
void priintArray(int arr[], int size)
5+
{
6+
for (int i = 0; i < size; i++)
7+
{
8+
cout << "The value of i is " << arr[i] << endl;
9+
}
10+
cout << "Print ho gya bhaiya aab" << endl;
11+
}
12+
13+
int main()
14+
{
15+
int beta[5]; // Isko bolte declare krna thik ha
16+
17+
cout << "The Value of beta at 5 is " << beta[4] << endl;
18+
19+
cout << "Tha value of 2 is " << beta[2] << endl;
20+
21+
int awash[4] = {1, 2, 3, 4}; // Aur isko bolte hai arrays ko initialise krna
22+
23+
cout << "The value of awash at index of 4 is :- " << awash[4] << endl;
24+
25+
int abhishek[20] = {12, 14};
26+
27+
priintArray(abhishek, 20);
28+
29+
int battery[20] = {15, 29};
30+
31+
priintArray(battery, 20);
32+
33+
int battery2[25] = {2, 4, 5, 6, 7};
34+
35+
for (int i = 0; i < 20; i++)
36+
{
37+
int ashutosh = battery2[i] = 1;
38+
cout << "The value of i is in Case of Battery 😀 " << ashutosh << endl;
39+
}
40+
41+
int sizeofBattery2 = sizeof(battery2)/sizeof(int); // ! iska hi use karke hum kisi bhi arrya ka size bahut easly find kaar sekte hai ,lekin pta hai isme ek error hai aur wo ye erroe hai ki hamne to battery2 ke andar 3 hi element ko initialise kiya hai n .........?🤔
42+
43+
cout << "The Size of battery2 is :- " << sizeofBattery2 <<endl;
44+
45+
// Character Arrays :-👉
46+
47+
char ashu[12] = {'a','b'};
48+
49+
cout << ashu[12] << endl;
50+
51+
return 0;
52+
}

Arrays/Basics.exe

45.3 KB
Binary file not shown.

Arrays/Max-Min.cpp

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#include <iostream>
2+
#include <climits>
3+
4+
using namespace std;
5+
6+
int getMax(int num[], int n)
7+
{
8+
int max = INT_MIN; // ye minimum number ko store krta hai
9+
10+
for (int i = 0; i < n; i++)
11+
{
12+
if (num[i] > max)
13+
{
14+
int max = num[i];
15+
}
16+
}
17+
18+
return max;
19+
}
20+
21+
int getMin(int num[], int n)
22+
{
23+
int min = INT_MAX; // Ye maximu number ko store krta hai
24+
25+
for (int i = 0; i < n; i++)
26+
{
27+
if (num[i] < min)
28+
{
29+
int min = num[i];
30+
}
31+
}
32+
33+
return min;
34+
}
35+
36+
int main()
37+
{
38+
int size;
39+
40+
cin >> size;
41+
42+
// int num[size] ; // yaad rahe kabhi ye practise nhi karna chaiye kyuki ye sabse bad practise hota hai
43+
44+
int num[100]; // aise le sekte hai ye phir bhi thik hai but upper wala nhi le sekte hai
45+
46+
for (int i = 0; i < size; i++)
47+
{
48+
49+
// Aur array ke case mein hum aise input lete ha
50+
51+
cin >> num[i];
52+
}
53+
54+
cout << "Maximum Value is :- " << getMax(num, size) << endl;
55+
cout << "Minimum Value is :- " << getMin(num, size) << endl;
56+
57+
return 0;
58+
}

Arrays/Max-Min.exe

44.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)