├── .gitattributes
├── .gitignore
├── ConsoleApp2
├── ConsoleApp2.sln
└── ConsoleApp2
│ ├── ConsoleApp2.csproj
│ └── Program.cs
├── ConsoleApp3
├── ConsoleApp3.sln
└── ConsoleApp3
│ ├── ConsoleApp3.csproj
│ └── Program.cs
├── ConsoleApp4
├── ConsoleApp4.sln
└── ConsoleApp4
│ ├── ConsoleApp4.csproj
│ └── Program.cs
├── Program.cs
├── README.md
├── abstractclass
├── abstractclass.sln
└── abstractclass
│ ├── Program.cs
│ └── abstractclass.csproj
├── accessSpecifierEg
├── accessSpecifierEg.sln
└── accessSpecifierEg
│ ├── Program.cs
│ └── accessSpecifierEg.csproj
├── array
├── array.sln
└── array
│ ├── Program.cs
│ └── array.csproj
├── arrayEg
├── arrayEg.sln
└── arrayEg
│ ├── Program.cs
│ └── arrayEg.csproj
├── arrayMMethhods
├── arrayMMethhods.sln
└── arrayMMethhods
│ ├── Program.cs
│ └── arrayMMethhods.csproj
├── arraymethods2wd
├── arraymethods2wd.sln
└── arraymethods2wd
│ ├── Program.cs
│ └── arraymethods2wd.csproj
├── c#.csproj
├── c#.generated.sln
├── classAndObjects
├── classAndObjects.sln
└── classAndObjects
│ ├── Human.cs
│ ├── Messages.cs
│ ├── Newcar.cs
│ ├── Program.cs
│ ├── car.cs
│ ├── classAndObjects.csproj
│ ├── humanconstructor.cs
│ └── vehicle.cs
├── collections
├── collections.sln
└── collections
│ ├── Program.cs
│ └── collections.csproj
├── delegatesInCSharp
├── delegatesInCSharp.sln
└── delegatesInCSharp
│ ├── Program.cs
│ └── delegatesInCSharp.csproj
├── enumeg
├── enumeg.sln
└── enumeg
│ ├── Program.cs
│ └── enumeg.csproj
├── exceptionhandling
├── exceptionhandling.sln
└── exceptionhandling
│ ├── Program.cs
│ └── exceptionhandling.csproj
├── genericInChsharp
├── genericInChsharp.sln
└── genericInChsharp
│ ├── Program.cs
│ └── genericInChsharp.csproj
├── gettersandsetters
├── gettersandsetters.sln
└── gettersandsetters
│ ├── Program.cs
│ └── gettersandsetters.csproj
├── hashset
├── hashset.sln
└── hashset
│ ├── Program.cs
│ └── hashset.csproj
├── hashsetAndListandEnum
├── hashsetAndListandEnum.sln
└── hashsetAndListandEnum
│ ├── Program.cs
│ └── hashsetAndListandEnum.csproj
├── hello wor;ld
├── hello wor;ld.sln
└── hello wor;ld
│ ├── Program.cs
│ └── hello wor;ld.csproj
├── helloworld
├── helloworld.sln
└── helloworld
│ ├── Program.cs
│ └── helloworld.csproj
├── inheritence
├── inheritence.sln
└── inheritence
│ ├── Program.cs
│ └── inheritence.csproj
├── interfaceExample
├── interfaceExample.sln
└── interfaceExample
│ ├── Program.cs
│ └── interfaceExample.csproj
├── jaggedarray
├── jaggedarray.sln
└── jaggedarray
│ ├── Program.cs
│ └── jaggedarray.csproj
├── leecode796
├── leecode796.sln
└── leecode796
│ ├── Program.cs
│ └── leecode796.csproj
├── leetCode-167
├── leetCode-167.sln
└── leetCode-167
│ ├── Program.cs
│ └── leetCode-167.csproj
├── leetcode-qst-2914
├── leetcode-qst-2914.sln
└── leetcode-qst-2914
│ ├── Program.cs
│ └── leetcode-qst-2914.csproj
├── leetcode2180
├── leetcode2180.sln
└── leetcode2180
│ ├── Program.cs
│ └── leetcode2180.csproj
├── leetcode3289
├── leetcode3289.sln
└── leetcode3289
│ ├── Program.cs
│ └── leetcode3289.csproj
├── leetcodeSolving
├── leetcodeSolving.sln
└── leetcodeSolving
│ ├── Program.cs
│ └── leetcodeSolving.csproj
├── linqInCSharpBasic
├── linqInCSharpBasic.sln
└── linqInCSharpBasic
│ ├── Program.cs
│ └── linqInCSharpBasic.csproj
├── linqeg4
├── linqeg4.sln
└── linqeg4
│ ├── Program.cs
│ └── linqeg4.csproj
├── lissteg
├── lissteg.sln
└── lissteg
│ ├── Program.cs
│ └── lissteg.csproj
├── methodOverriding
├── methodOverriding.sln
└── methodOverriding
│ ├── Program.cs
│ └── methodOverriding.csproj
├── string
├── string.sln
└── string
│ ├── Program.cs
│ └── string.csproj
├── strucEg
├── strucEg.sln
└── strucEg
│ ├── Program.cs
│ └── strucEg.csproj
├── struct
├── struct.sln
└── struct
│ ├── Program.cs
│ └── struct.csproj
├── structInCsharp
├── structInCsharp.sln
└── structInCsharp
│ ├── Program.cs
│ └── structInCsharp.csproj
└── threadinCsharp
├── threadinCsharp.sln
└── threadinCsharp
├── Program.cs
└── threadinCsharp.csproj
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Oo]ut/
33 | [Ll]og/
34 | [Ll]ogs/
35 |
36 | # Visual Studio 2015/2017 cache/options directory
37 | .vs/
38 | # Uncomment if you have tasks that create the project's static files in wwwroot
39 | #wwwroot/
40 |
41 | # Visual Studio 2017 auto generated files
42 | Generated\ Files/
43 |
44 | # MSTest test Results
45 | [Tt]est[Rr]esult*/
46 | [Bb]uild[Ll]og.*
47 |
48 | # NUnit
49 | *.VisualState.xml
50 | TestResult.xml
51 | nunit-*.xml
52 |
53 | # Build Results of an ATL Project
54 | [Dd]ebugPS/
55 | [Rr]eleasePS/
56 | dlldata.c
57 |
58 | # Benchmark Results
59 | BenchmarkDotNet.Artifacts/
60 |
61 | # .NET Core
62 | project.lock.json
63 | project.fragment.lock.json
64 | artifacts/
65 |
66 | # ASP.NET Scaffolding
67 | ScaffoldingReadMe.txt
68 |
69 | # StyleCop
70 | StyleCopReport.xml
71 |
72 | # Files built by Visual Studio
73 | *_i.c
74 | *_p.c
75 | *_h.h
76 | *.ilk
77 | *.meta
78 | *.obj
79 | *.iobj
80 | *.pch
81 | *.pdb
82 | *.ipdb
83 | *.pgc
84 | *.pgd
85 | *.rsp
86 | *.sbr
87 | *.tlb
88 | *.tli
89 | *.tlh
90 | *.tmp
91 | *.tmp_proj
92 | *_wpftmp.csproj
93 | *.log
94 | *.vspscc
95 | *.vssscc
96 | .builds
97 | *.pidb
98 | *.svclog
99 | *.scc
100 |
101 | # Chutzpah Test files
102 | _Chutzpah*
103 |
104 | # Visual C++ cache files
105 | ipch/
106 | *.aps
107 | *.ncb
108 | *.opendb
109 | *.opensdf
110 | *.sdf
111 | *.cachefile
112 | *.VC.db
113 | *.VC.VC.opendb
114 |
115 | # Visual Studio profiler
116 | *.psess
117 | *.vsp
118 | *.vspx
119 | *.sap
120 |
121 | # Visual Studio Trace Files
122 | *.e2e
123 |
124 | # TFS 2012 Local Workspace
125 | $tf/
126 |
127 | # Guidance Automation Toolkit
128 | *.gpState
129 |
130 | # ReSharper is a .NET coding add-in
131 | _ReSharper*/
132 | *.[Rr]e[Ss]harper
133 | *.DotSettings.user
134 |
135 | # TeamCity is a build add-in
136 | _TeamCity*
137 |
138 | # DotCover is a Code Coverage Tool
139 | *.dotCover
140 |
141 | # AxoCover is a Code Coverage Tool
142 | .axoCover/*
143 | !.axoCover/settings.json
144 |
145 | # Coverlet is a free, cross platform Code Coverage Tool
146 | coverage*.json
147 | coverage*.xml
148 | coverage*.info
149 |
150 | # Visual Studio code coverage results
151 | *.coverage
152 | *.coveragexml
153 |
154 | # NCrunch
155 | _NCrunch_*
156 | .*crunch*.local.xml
157 | nCrunchTemp_*
158 |
159 | # MightyMoose
160 | *.mm.*
161 | AutoTest.Net/
162 |
163 | # Web workbench (sass)
164 | .sass-cache/
165 |
166 | # Installshield output folder
167 | [Ee]xpress/
168 |
169 | # DocProject is a documentation generator add-in
170 | DocProject/buildhelp/
171 | DocProject/Help/*.HxT
172 | DocProject/Help/*.HxC
173 | DocProject/Help/*.hhc
174 | DocProject/Help/*.hhk
175 | DocProject/Help/*.hhp
176 | DocProject/Help/Html2
177 | DocProject/Help/html
178 |
179 | # Click-Once directory
180 | publish/
181 |
182 | # Publish Web Output
183 | *.[Pp]ublish.xml
184 | *.azurePubxml
185 | # Note: Comment the next line if you want to checkin your web deploy settings,
186 | # but database connection strings (with potential passwords) will be unencrypted
187 | *.pubxml
188 | *.publishproj
189 |
190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
191 | # checkin your Azure Web App publish settings, but sensitive information contained
192 | # in these scripts will be unencrypted
193 | PublishScripts/
194 |
195 | # NuGet Packages
196 | *.nupkg
197 | # NuGet Symbol Packages
198 | *.snupkg
199 | # The packages folder can be ignored because of Package Restore
200 | **/[Pp]ackages/*
201 | # except build/, which is used as an MSBuild target.
202 | !**/[Pp]ackages/build/
203 | # Uncomment if necessary however generally it will be regenerated when needed
204 | #!**/[Pp]ackages/repositories.config
205 | # NuGet v3's project.json files produces more ignorable files
206 | *.nuget.props
207 | *.nuget.targets
208 |
209 | # Microsoft Azure Build Output
210 | csx/
211 | *.build.csdef
212 |
213 | # Microsoft Azure Emulator
214 | ecf/
215 | rcf/
216 |
217 | # Windows Store app package directories and files
218 | AppPackages/
219 | BundleArtifacts/
220 | Package.StoreAssociation.xml
221 | _pkginfo.txt
222 | *.appx
223 | *.appxbundle
224 | *.appxupload
225 |
226 | # Visual Studio cache files
227 | # files ending in .cache can be ignored
228 | *.[Cc]ache
229 | # but keep track of directories ending in .cache
230 | !?*.[Cc]ache/
231 |
232 | # Others
233 | ClientBin/
234 | ~$*
235 | *~
236 | *.dbmdl
237 | *.dbproj.schemaview
238 | *.jfm
239 | *.pfx
240 | *.publishsettings
241 | orleans.codegen.cs
242 |
243 | # Including strong name files can present a security risk
244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
245 | #*.snk
246 |
247 | # Since there are multiple workflows, uncomment next line to ignore bower_components
248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
249 | #bower_components/
250 |
251 | # RIA/Silverlight projects
252 | Generated_Code/
253 |
254 | # Backup & report files from converting an old project file
255 | # to a newer Visual Studio version. Backup files are not needed,
256 | # because we have git ;-)
257 | _UpgradeReport_Files/
258 | Backup*/
259 | UpgradeLog*.XML
260 | UpgradeLog*.htm
261 | ServiceFabricBackup/
262 | *.rptproj.bak
263 |
264 | # SQL Server files
265 | *.mdf
266 | *.ldf
267 | *.ndf
268 |
269 | # Business Intelligence projects
270 | *.rdl.data
271 | *.bim.layout
272 | *.bim_*.settings
273 | *.rptproj.rsuser
274 | *- [Bb]ackup.rdl
275 | *- [Bb]ackup ([0-9]).rdl
276 | *- [Bb]ackup ([0-9][0-9]).rdl
277 |
278 | # Microsoft Fakes
279 | FakesAssemblies/
280 |
281 | # GhostDoc plugin setting file
282 | *.GhostDoc.xml
283 |
284 | # Node.js Tools for Visual Studio
285 | .ntvs_analysis.dat
286 | node_modules/
287 |
288 | # Visual Studio 6 build log
289 | *.plg
290 |
291 | # Visual Studio 6 workspace options file
292 | *.opt
293 |
294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
295 | *.vbw
296 |
297 | # Visual Studio LightSwitch build output
298 | **/*.HTMLClient/GeneratedArtifacts
299 | **/*.DesktopClient/GeneratedArtifacts
300 | **/*.DesktopClient/ModelManifest.xml
301 | **/*.Server/GeneratedArtifacts
302 | **/*.Server/ModelManifest.xml
303 | _Pvt_Extensions
304 |
305 | # Paket dependency manager
306 | .paket/paket.exe
307 | paket-files/
308 |
309 | # FAKE - F# Make
310 | .fake/
311 |
312 | # CodeRush personal settings
313 | .cr/personal
314 |
315 | # Python Tools for Visual Studio (PTVS)
316 | __pycache__/
317 | *.pyc
318 |
319 | # Cake - Uncomment if you are using it
320 | # tools/**
321 | # !tools/packages.config
322 |
323 | # Tabs Studio
324 | *.tss
325 |
326 | # Telerik's JustMock configuration file
327 | *.jmconfig
328 |
329 | # BizTalk build output
330 | *.btp.cs
331 | *.btm.cs
332 | *.odx.cs
333 | *.xsd.cs
334 |
335 | # OpenCover UI analysis results
336 | OpenCover/
337 |
338 | # Azure Stream Analytics local run output
339 | ASALocalRun/
340 |
341 | # MSBuild Binary and Structured Log
342 | *.binlog
343 |
344 | # NVidia Nsight GPU debugger configuration file
345 | *.nvuser
346 |
347 | # MFractors (Xamarin productivity tool) working folder
348 | .mfractor/
349 |
350 | # Local History for Visual Studio
351 | .localhistory/
352 |
353 | # BeatPulse healthcheck temp database
354 | healthchecksdb
355 |
356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
357 | MigrationBackup/
358 |
359 | # Ionide (cross platform F# VS Code tools) working folder
360 | .ionide/
361 |
362 | # Fody - auto-generated XML schema
363 | FodyWeavers.xsd
--------------------------------------------------------------------------------
/ConsoleApp2/ConsoleApp2.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp2", "ConsoleApp2\ConsoleApp2.csproj", "{D4D2BCD1-5AD8-454C-A93D-A8A0270010F4}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {D4D2BCD1-5AD8-454C-A93D-A8A0270010F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {D4D2BCD1-5AD8-454C-A93D-A8A0270010F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {D4D2BCD1-5AD8-454C-A93D-A8A0270010F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {D4D2BCD1-5AD8-454C-A93D-A8A0270010F4}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {A016778E-9EF7-44B7-BBA7-7F39ED3DB4C0}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/ConsoleApp2/ConsoleApp2/ConsoleApp2.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ConsoleApp2/ConsoleApp2/Program.cs:
--------------------------------------------------------------------------------
1 | namespace ConsoleApp2
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | Console.WriteLine("Hello, World!");
8 | Back.Hello("salih");
9 | Console.WriteLine("completed");
10 | Myconstructor my = new Myconstructor("salih");
11 | string greet=my.Message();
12 | Myname name = new Myname("salih");
13 | Console.WriteLine(name.Message());
14 | }
15 |
16 | }
17 | public static class Back
18 | {
19 | public static void Hello(string message)
20 | {
21 | Console.WriteLine(message);
22 |
23 | }
24 | }
25 | public class Myconstructor
26 | {
27 | string message;
28 | public Myconstructor(string message)
29 | {
30 | this.message=message;
31 | }
32 | public string Message()
33 | {
34 | return "hello"+message;
35 | }
36 | }
37 | public class Myname : Myconstructor
38 | {
39 | string name;
40 | public Myname(string message) : base(message)
41 | {
42 | this.name=message;
43 | }
44 | public string Message()
45 | {
46 | return "hello "+name;
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/ConsoleApp3/ConsoleApp3.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp3", "ConsoleApp3\ConsoleApp3.csproj", "{DFDEA119-5373-446F-A508-0378CCC5BEEB}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {DFDEA119-5373-446F-A508-0378CCC5BEEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {DFDEA119-5373-446F-A508-0378CCC5BEEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {DFDEA119-5373-446F-A508-0378CCC5BEEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {DFDEA119-5373-446F-A508-0378CCC5BEEB}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {E0589126-107B-4D17-81B1-818094A184A0}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/ConsoleApp3/ConsoleApp3/ConsoleApp3.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ConsoleApp3/ConsoleApp3/Program.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection.Emit;
2 |
3 | namespace ConsoleApp3
4 | {
5 | internal class Program
6 | {
7 | static void Main(string[] args)
8 | {
9 | Console.WriteLine("start");
10 | bool b=false;
11 | if(b)
12 | goto label1;
13 | else goto label2;
14 | label1:
15 | Console.WriteLine("label 1");
16 | label2:
17 | Console.WriteLine("label 2");
18 | Console.WriteLine("end");
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/ConsoleApp4/ConsoleApp4.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp4", "ConsoleApp4\ConsoleApp4.csproj", "{CB180D72-BDAA-4A15-A4FB-0F01560BFF2F}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {CB180D72-BDAA-4A15-A4FB-0F01560BFF2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {CB180D72-BDAA-4A15-A4FB-0F01560BFF2F}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {CB180D72-BDAA-4A15-A4FB-0F01560BFF2F}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {CB180D72-BDAA-4A15-A4FB-0F01560BFF2F}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {92D3E73D-4B62-4BC8-A308-2269C62561CA}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/ConsoleApp4/ConsoleApp4/ConsoleApp4.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ConsoleApp4/ConsoleApp4/Program.cs:
--------------------------------------------------------------------------------
1 | namespace ConsoleApp4
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | List list = new List()
8 | {
9 | new Employee {Id=1,Name="salih",Salary=5000,Department="it"},
10 | new Employee {Id=2,Name="goopz",Salary=2000,Department="sales"},
11 | new Employee {Id=3,Name="fasal",Salary=3000,Department="it"},
12 | new Employee {Id=4,Name="priya",Salary=4000,Department="finance"},
13 | };
14 | //var highsal=from emp in list //query syntax
15 | // where emp.Salary>3000
16 | // select emp;
17 | var highsal = list.Where(e => e.Salary > 3000); //lambda expression
18 | foreach (var emp in highsal )
19 | {
20 | Console.WriteLine(emp.Name+" = "+emp.Salary );
21 | }
22 | //var ordering=from emp in list
23 | // orderby emp.Salary
24 | // select emp;
25 | var ordering = list.OrderBy(e => e.Salary);
26 | foreach (var emp in ordering)
27 | {
28 | Console.WriteLine(emp.Name + " = " + emp.Salary);
29 | }
30 | }
31 | }
32 | public class Employee
33 | {
34 | public int Id { get; set; }
35 | public string Name { get; set; }
36 | public int Salary { get; set; }
37 | public string Department { get; set; }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Program.cs:
--------------------------------------------------------------------------------
1 | // Console.WriteLine("salih");
2 | // int n=10;
3 | // float f=1.5f;
4 | // long lo=1233455;
5 | // bool bl=true;
6 | // char c='q';
7 | // String str="salih";
8 | // Console.WriteLine(n+f+lo);
9 | // Console.WriteLine(c+str+" is"+bl);
10 | // Console.WriteLine("enter ur name");
11 | // String? name=Console.ReadLine();
12 | // Console.WriteLine("enter ur age");
13 | // int age=Convert.ToInt32(Console.ReadLine());
14 | // Console.WriteLine("your name is"+name+"your age is"+age);
15 | void message(){
16 | Console.WriteLine("hello world");
17 | }
18 | message();
19 | void sum(int a,int b){
20 | Console.WriteLine(a+b);
21 | }
22 | sum(12,34);
23 | float mul(float a,int b){
24 | return a*b;
25 | }
26 | Console.WriteLine(mul(12.34f,34));
27 |
28 | // String s=null;
29 | // String reuslt=s??"hii";
30 | // Console.WriteLine(reuslt);
31 | // s??="hii";
32 | // Console.WriteLine(s);
33 | Console.WriteLine("enter ur name ");
34 | String? name=Console.ReadLine();
35 | int age=Convert.ToInt32(Console.ReadLine());
36 | Console.WriteLine("ur name is "+name.GetType()+"ur age is "+age.GetType());
37 | // int nameint=Convert.
38 | String[] cars={"bugatti","ferrari"};
39 | Console.WriteLine(cars);
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # c#
--------------------------------------------------------------------------------
/abstractclass/abstractclass.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "abstractclass", "abstractclass\abstractclass.csproj", "{8DF5068F-7785-423A-855F-4F9AAA0788D1}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {8DF5068F-7785-423A-855F-4F9AAA0788D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {8DF5068F-7785-423A-855F-4F9AAA0788D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {8DF5068F-7785-423A-855F-4F9AAA0788D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {8DF5068F-7785-423A-855F-4F9AAA0788D1}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {A9186F9F-6D52-41E5-AE1F-695003DC1F7B}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/abstractclass/abstractclass/Program.cs:
--------------------------------------------------------------------------------
1 | namespace abstractclass
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | Dog dog = new Dog();
8 | dog.makesound();
9 |
10 | }
11 | }
12 | // craeting abstract class
13 | public abstract class Animal
14 | {
15 | public abstract void makesound();
16 | }
17 | public class Dog:Animal //inheriting abstract class
18 | {
19 | public override void makesound() //implementing abstract method
20 | {
21 | Console.WriteLine("bow bow");
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/abstractclass/abstractclass/abstractclass.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/accessSpecifierEg/accessSpecifierEg.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "accessSpecifierEg", "accessSpecifierEg\accessSpecifierEg.csproj", "{F893EE7A-16EC-420E-8E78-54D57CCE25AF}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {F893EE7A-16EC-420E-8E78-54D57CCE25AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {F893EE7A-16EC-420E-8E78-54D57CCE25AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {F893EE7A-16EC-420E-8E78-54D57CCE25AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {F893EE7A-16EC-420E-8E78-54D57CCE25AF}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {C53DD75A-C404-4D8C-A115-257E108565E0}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/accessSpecifierEg/accessSpecifierEg/Program.cs:
--------------------------------------------------------------------------------
1 | namespace accessSpecifierEg
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | Student student = new Student();
8 | Eachstudent eachstd=new Eachstudent();
9 | Console.WriteLine(student.name);
10 | //Console.WriteLine(student.age);
11 | //Console.WriteLine(student.getAge());
12 | Console.WriteLine(eachstd.getAge());
13 | eachstd.hello("salih");
14 | }
15 | }
16 | public class Student
17 | {
18 | public string name = "salih";
19 | private int age = 22;
20 | public int getAge()
21 | {
22 | return age;
23 | }
24 | public void hello()
25 | {
26 | Console.WriteLine("helllo");
27 | }
28 | }
29 | public class Eachstudent : Student
30 | {
31 |
32 | public int displayage()
33 | {
34 | return getAge();
35 | }
36 | public void hello(string name)
37 | {
38 | Console.WriteLine(name);
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/accessSpecifierEg/accessSpecifierEg/accessSpecifierEg.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/array/array.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "array", "array\array.csproj", "{49EC6AB5-E5E3-4B34-875D-04C5480AA4EC}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {49EC6AB5-E5E3-4B34-875D-04C5480AA4EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {49EC6AB5-E5E3-4B34-875D-04C5480AA4EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {49EC6AB5-E5E3-4B34-875D-04C5480AA4EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {49EC6AB5-E5E3-4B34-875D-04C5480AA4EC}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {C5A82D92-9E55-49CF-84D6-6356CFA904B8}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/array/array/Program.cs:
--------------------------------------------------------------------------------
1 | namespace array
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | int size = 3;
8 | string s = "hii";
9 | Console.WriteLine(s);
10 | String[] cars = {"bugatti","pagani","bmw"};
11 | Console.WriteLine(cars);
12 | foreach (var item in cars)
13 | {
14 | Console.WriteLine(item);
15 | }
16 | Console.WriteLine(sum(10, 667));
17 | Console.WriteLine(sum(10, 667,98));
18 | int[,] table = {
19 | { 1, 2, 3 },
20 | { 4, 5, 6 },
21 | { 7, 8, 9 }
22 | };
23 | for (int i = 0; i < table.GetLength(0); i++)
24 | {
25 | for (int j = 0; j < table.GetLength(0); j++)
26 | {
27 | Console.WriteLine(table[i, j]);
28 | }
29 | }
30 |
31 | }
32 | static int sum(int a,int b)
33 | {
34 | return a + b;
35 | }
36 | static int sum(int a, int b, int c) {
37 | return a + b + c;
38 | }
39 | static void display(int[] arr)
40 | {
41 | foreach(int item in arr) Console.WriteLine(item);
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/array/array/array.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/arrayEg/arrayEg.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "arrayEg", "arrayEg\arrayEg.csproj", "{5E42B1AE-C723-49DC-9705-70DDA5AFF012}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {5E42B1AE-C723-49DC-9705-70DDA5AFF012}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {5E42B1AE-C723-49DC-9705-70DDA5AFF012}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {5E42B1AE-C723-49DC-9705-70DDA5AFF012}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {5E42B1AE-C723-49DC-9705-70DDA5AFF012}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {113062A0-12E1-4589-8D5C-2C593F6F3C7B}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/arrayEg/arrayEg/Program.cs:
--------------------------------------------------------------------------------
1 | namespace arrayEg
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | Console.WriteLine("enter size of the arra");
8 | int n=int.Parse(Console.ReadLine());
9 | int[] a = new int[n];
10 | for(int i = 0; i < a.Length; i++)
11 | {
12 | a[i]=int.Parse(Console.ReadLine());
13 | }
14 | for(int i = 0;i < a.Length; i++)
15 | {
16 | Console.WriteLine(a[i]);
17 | }
18 | string[] b = { "bugatti", "pagani" };
19 | foreach(string i in b)
20 | {
21 | Console.WriteLine(i);
22 | }
23 | var s = b.Where(n => n == "bugatti");
24 | Console.WriteLine(string.Join(", ",s));
25 | var s1 = b.FirstOrDefault(n => n == "pagani");
26 | Console.WriteLine(s1);
27 | Console.WriteLine(string.Join(" ", a));
28 | string msg = "hello world ";
29 | Console.WriteLine(string.Join(" ",msg.Split(" ")));
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/arrayEg/arrayEg/arrayEg.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/arrayMMethhods/arrayMMethhods.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "arrayMMethhods", "arrayMMethhods\arrayMMethhods.csproj", "{141210ED-A137-4131-9875-C061F8AD6807}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {141210ED-A137-4131-9875-C061F8AD6807}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {141210ED-A137-4131-9875-C061F8AD6807}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {141210ED-A137-4131-9875-C061F8AD6807}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {141210ED-A137-4131-9875-C061F8AD6807}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {5DD7A720-9CFB-4A45-8CAB-BF6D5EA26D52}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/arrayMMethhods/arrayMMethhods/Program.cs:
--------------------------------------------------------------------------------
1 | namespace arrayMMethhods
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 |
8 | int[] arr = { 1, 2, 3, 4, 5, };
9 | Array myArray=Array.CreateInstance(typeof(int),5);
10 | foreach(int i in myArray)
11 | {
12 | Console.WriteLine(i);
13 | }
14 |
15 | string s = "hello";
16 | s = "h";
17 | Console.WriteLine(s);
18 | Console.Beep();
19 | int dec = 10;
20 | int bin=0b10;
21 | int hexx = 0X12f;
22 | Console.WriteLine($"decimal = {dec} binary = {bin} hexadecimal = {hexx}");
23 | double a = 10.15; //By Default Floating Point Literal is double
24 | //Float Literal
25 | float b = 100.72F; //Suffix with F
26 | //Double Literal
27 | double c = 1.45D; //Suffix with D
28 | //Decimal Literal
29 | decimal d = 1.44M; //Suffix with M
30 |
31 | Console.WriteLine($"Double Literal: {a}");
32 | Console.WriteLine($"Float Literal: {b}");
33 | Console.WriteLine($"Double Literal: {c}");
34 | Console.WriteLine($"Decimal Literal: {d}");
35 | Console.WriteLine("hloo \n how are \t u");
36 | Console.WriteLine(@"helllo \n how are \t u");
37 | Console.ReadKey();
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/arrayMMethhods/arrayMMethhods/arrayMMethhods.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/arraymethods2wd/arraymethods2wd.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "arraymethods2wd", "arraymethods2wd\arraymethods2wd.csproj", "{7C9F849C-4084-469A-B061-F40B09A8CB52}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {7C9F849C-4084-469A-B061-F40B09A8CB52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {7C9F849C-4084-469A-B061-F40B09A8CB52}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {7C9F849C-4084-469A-B061-F40B09A8CB52}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {7C9F849C-4084-469A-B061-F40B09A8CB52}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {7C6B5246-8774-4B3A-B71A-EAB3D2038AE8}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/arraymethods2wd/arraymethods2wd/Program.cs:
--------------------------------------------------------------------------------
1 | namespace arraymethods2wd
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | int[] arr= { 11, 2, 13 ,4};
8 | string[] s = { "hello", "hii", "abs", "bn" };
9 | foreach (string i in s) {
10 | Console.WriteLine(i);
11 | }
12 | Array.Sort(s);
13 | foreach (string i in s)
14 | {
15 | Console.WriteLine(i);
16 | }
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/arraymethods2wd/arraymethods2wd/arraymethods2wd.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/c#.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | c_
7 | enable
8 | enable
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/c#.generated.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.5.002.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "c#", "c#.csproj", "{21A27585-B737-4332-905B-B10589B54B98}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {21A27585-B737-4332-905B-B10589B54B98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {21A27585-B737-4332-905B-B10589B54B98}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {21A27585-B737-4332-905B-B10589B54B98}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {21A27585-B737-4332-905B-B10589B54B98}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {2027E07E-357A-4E09-9B2D-EE2B3150BC76}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/classAndObjects/classAndObjects.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "classAndObjects", "classAndObjects\classAndObjects.csproj", "{81765DA4-F92C-41FF-BDFF-4B111DF1F04E}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {81765DA4-F92C-41FF-BDFF-4B111DF1F04E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {81765DA4-F92C-41FF-BDFF-4B111DF1F04E}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {81765DA4-F92C-41FF-BDFF-4B111DF1F04E}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {81765DA4-F92C-41FF-BDFF-4B111DF1F04E}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {AD5A404B-0311-4EE2-85D5-928C59AA2775}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/classAndObjects/classAndObjects/Human.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace classAndObjects
8 | {
9 | public class Human
10 | {
11 | public Human() {
12 | Console.WriteLine("welcome new user");
13 |
14 | }
15 | public string name;
16 | public int age;
17 | public void hello()
18 | {
19 | Console.WriteLine($"hello {name} you are {age} old");
20 | }
21 | public void bye()
22 | {
23 | Console.WriteLine($"bye {name}");
24 | }
25 | public void thanks()
26 | {
27 | Console.WriteLine($"thanks {name} ");
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/classAndObjects/classAndObjects/Messages.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace classAndObjects
8 | {
9 | public static class Messages
10 | {
11 | public static void hello()
12 | {
13 | Console.WriteLine("hello ");
14 | }
15 | public static void bye()
16 | {
17 | Console.WriteLine("bye ");
18 | }
19 | public static void thanks()
20 | {
21 | Console.WriteLine("thanks ");
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/classAndObjects/classAndObjects/Newcar.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace classAndObjects
8 | {
9 | public class Newcar:Car
10 | {
11 | public string modal;
12 | public Newcar(string modal)
13 | {
14 | this.modal = modal;
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/classAndObjects/classAndObjects/Program.cs:
--------------------------------------------------------------------------------
1 | namespace classAndObjects
2 | {
3 | class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | //accessing properties of another class using classname
8 | Messages.hello();
9 | Messages.thanks();
10 | Messages.bye();
11 | //creating object
12 | Human human = new Human();
13 |
14 | //accesiing properties of class usig object
15 | human.name = "salih";
16 | human.age = 22;
17 | human.hello();
18 | human.thanks();
19 | human.bye();
20 | //contsructor using parameter
21 | Humanconstuctor hm = new Humanconstuctor("SALIH", 22);
22 | //clonstructor overload example
23 | Humanconstuctor hm1 = new Humanconstuctor("SALIH");
24 | hm.greet();
25 | //inheritance
26 | Car car = new Car();
27 | car.go();
28 | Newcar newcar = new Newcar("mustang");
29 | newcar.go();
30 | // Array of objects
31 |
32 | Newcar[] garrage = new Newcar[3];
33 | Newcar car1 = new Newcar("mclaren");
34 | Newcar car2 = new Newcar("hummer");
35 | Newcar car3 = new Newcar("bugatti");
36 | garrage[0] = car1;
37 | garrage[1] = car2;
38 | garrage[2] = car3;
39 | foreach (Newcar carname in garrage)
40 | {
41 | Console.WriteLine(carname.modal);
42 | }
43 | // Array of objects using anonymous objects
44 | Newcar[] garrage1 = { new Newcar("lamborghin"), new Newcar("ferrri"), new Newcar("pagani") };
45 | foreach(Newcar nameofcar in garrage1)
46 | {
47 | Console.WriteLine(nameofcar.modal);
48 | }
49 | //object as parameter
50 | changecolor(garrage1[0], "koenigsegg");
51 | Console.WriteLine(garrage1[0].modal);
52 | Newcar pagani = copycar(garrage1[1]);
53 | Console.WriteLine(pagani.modal);
54 | }
55 | public static void changecolor(Newcar car,string modalname)
56 | {
57 | car.modal = modalname;
58 | }
59 | public static Newcar copycar(Newcar car)
60 | {
61 | return new Newcar(car.modal);
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/classAndObjects/classAndObjects/car.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace classAndObjects
8 | {
9 | public class Car:Vehicle //inheriting Vehicle class
10 | {
11 |
12 | string name = "car";
13 | int wheels = 4;
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/classAndObjects/classAndObjects/classAndObjects.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/classAndObjects/classAndObjects/humanconstructor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Channels;
6 | using System.Threading.Tasks;
7 |
8 | namespace classAndObjects
9 | {
10 | public class Humanconstuctor
11 | {
12 | string name;
13 | //constructor creation
14 | public Humanconstuctor(string name,int age) {
15 | this.name = name;
16 | Console.WriteLine($"hii {name} u are {age} old ");
17 |
18 | }
19 | //constructor overload
20 | public Humanconstuctor(string name)
21 | {
22 | Console.WriteLine($"hii {name}");
23 | }
24 | public void greet()
25 | {
26 | Console.WriteLine(name);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/classAndObjects/classAndObjects/vehicle.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace classAndObjects
8 | {
9 | public class Vehicle
10 | {
11 | public void go()
12 | {
13 | Console.WriteLine("is going");
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/collections/collections.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "collections", "collections\collections.csproj", "{1398A72A-BA63-4EFA-9AE3-A609992BB135}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {1398A72A-BA63-4EFA-9AE3-A609992BB135}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {1398A72A-BA63-4EFA-9AE3-A609992BB135}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {1398A72A-BA63-4EFA-9AE3-A609992BB135}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {1398A72A-BA63-4EFA-9AE3-A609992BB135}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {73700646-E301-4D21-A91E-EAFF5B0ED76D}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/collections/collections/Program.cs:
--------------------------------------------------------------------------------
1 | namespace collections
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | List list = new List();
8 | list.Add("salu");
9 | list.Add("mueen");
10 | display(list);
11 | list.Remove("mueen");
12 | display(list);
13 | }
14 | static void display(List list)
15 | {
16 |
17 | foreach (string s in list)
18 | {
19 | Console.WriteLine(s);
20 | }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/collections/collections/collections.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/delegatesInCSharp/delegatesInCSharp.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "delegatesInCSharp", "delegatesInCSharp\delegatesInCSharp.csproj", "{07675152-9F8A-4721-9D20-DD74A81AC4A7}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {07675152-9F8A-4721-9D20-DD74A81AC4A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {07675152-9F8A-4721-9D20-DD74A81AC4A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {07675152-9F8A-4721-9D20-DD74A81AC4A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {07675152-9F8A-4721-9D20-DD74A81AC4A7}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {F30B6969-77BE-47F9-A9FE-16E926908119}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/delegatesInCSharp/delegatesInCSharp/Program.cs:
--------------------------------------------------------------------------------
1 | namespace delegatesInCSharp
2 | {
3 | internal class Program
4 | {
5 | delegate void Mydelegate(string name);//creating delegate
6 |
7 | static void Main(string[] args)
8 | {
9 | Mydelegate del = new Mydelegate(Displaymessage);
10 | //Mydelegate del = Displaymessage;
11 | del("salih");
12 | //multicaset delegate
13 | del += Displayhello;
14 | del("salu mon");
15 | }
16 | public static void Displaymessage(string name)
17 | {
18 | Console.WriteLine($"hii {name}");
19 | }
20 | public static void Displayhello(string name)
21 | {
22 | Console.WriteLine($"hii {name}");
23 | }
24 | }
25 |
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/delegatesInCSharp/delegatesInCSharp/delegatesInCSharp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/enumeg/enumeg.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "enumeg", "enumeg\enumeg.csproj", "{BC054617-DDF7-438D-8134-9B0B79CF0635}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {BC054617-DDF7-438D-8134-9B0B79CF0635}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {BC054617-DDF7-438D-8134-9B0B79CF0635}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {BC054617-DDF7-438D-8134-9B0B79CF0635}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {BC054617-DDF7-438D-8134-9B0B79CF0635}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {F2CAF21E-17AD-4B68-BA2B-9793951ED0EB}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/enumeg/enumeg/Program.cs:
--------------------------------------------------------------------------------
1 | using System.Security.Cryptography.X509Certificates;
2 |
3 | namespace enumeg
4 | {
5 | internal class Program
6 | {
7 | static void Main(string[] args)
8 | {
9 | Console.WriteLine((int)Days.monday);
10 |
11 | }
12 | }
13 | public enum Days:short
14 | {
15 | sunday=12,
16 | monday
17 |
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/enumeg/enumeg/enumeg.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/exceptionhandling/exceptionhandling.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "exceptionhandling", "exceptionhandling\exceptionhandling.csproj", "{447A11E0-C0AB-4939-80EA-6ECA6BBE4E05}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {447A11E0-C0AB-4939-80EA-6ECA6BBE4E05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {447A11E0-C0AB-4939-80EA-6ECA6BBE4E05}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {447A11E0-C0AB-4939-80EA-6ECA6BBE4E05}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {447A11E0-C0AB-4939-80EA-6ECA6BBE4E05}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {A8339900-263C-4FB0-9F11-3C90D9A62519}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/exceptionhandling/exceptionhandling/Program.cs:
--------------------------------------------------------------------------------
1 | namespace exceptionhandling
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | Console.WriteLine("enter two numbers:");
8 | int a=Convert.ToInt32(Console.ReadLine());
9 | int b = Convert.ToInt32(Console.ReadLine());
10 | double result = 0;
11 | try {
12 | result = a / b;
13 | Console.WriteLine(result);
14 |
15 | }
16 | catch (Exception e)
17 | {
18 | Console.WriteLine("error enter correctly"+e);
19 | }
20 | finally
21 | {
22 | Console.WriteLine("thanks!");
23 |
24 |
25 | }
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/exceptionhandling/exceptionhandling/exceptionhandling.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/genericInChsharp/genericInChsharp.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "genericInChsharp", "genericInChsharp\genericInChsharp.csproj", "{07725D47-0250-4A21-8F09-57E8084CDC99}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {07725D47-0250-4A21-8F09-57E8084CDC99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {07725D47-0250-4A21-8F09-57E8084CDC99}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {07725D47-0250-4A21-8F09-57E8084CDC99}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {07725D47-0250-4A21-8F09-57E8084CDC99}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {F86FC001-37E3-4273-8E49-9B49BDC165DF}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/genericInChsharp/genericInChsharp/Program.cs:
--------------------------------------------------------------------------------
1 | namespace genericInChsharp
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | GenericEg g = new GenericEg();
8 | g.Additem(1);
9 | g.Additem(2);
10 | g.Additem(3);
11 | g.display();
12 | g.Clearitem(3);
13 | g.display();
14 | g.onevalue();
15 | GenericEg g1 = new GenericEg();
16 | g1.Additem("salih");
17 | g1.Additem("mueen");
18 | g1.Additem("anas");
19 | g1.display();
20 | g1.Clearitem("anas");
21 | g1.display();
22 | g1.onevalue();
23 | }
24 | }
25 | public class GenericEg//specifying a generic type in class
26 | {
27 | public List list = new List();
28 | public void Additem(T item)//specifying a generic type in parameter
29 | {
30 | list.Add(item);
31 | }
32 | public void Clearitem(T item) {
33 | list.Remove(item);
34 | }
35 | public void display()
36 | {
37 | foreach(T i in list)
38 | {
39 | Console.WriteLine(i);
40 | }
41 | }
42 | public T onevalue()//specifying a generic type in return type
43 | {
44 | return list[0];
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/genericInChsharp/genericInChsharp/genericInChsharp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/gettersandsetters/gettersandsetters.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "gettersandsetters", "gettersandsetters\gettersandsetters.csproj", "{E04045D0-07BD-4F76-8DFD-47E0C8A49FFF}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {E04045D0-07BD-4F76-8DFD-47E0C8A49FFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {E04045D0-07BD-4F76-8DFD-47E0C8A49FFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {E04045D0-07BD-4F76-8DFD-47E0C8A49FFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {E04045D0-07BD-4F76-8DFD-47E0C8A49FFF}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {B13E4291-A65F-48EB-BE79-DA184BC80A4F}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/gettersandsetters/gettersandsetters/Program.cs:
--------------------------------------------------------------------------------
1 | namespace gettersandsetters
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | Car car = new Car(100);
8 | Console.WriteLine(car.Speed);
9 | car.Speed = 100000;
10 | Console.WriteLine(car.Speed);
11 | //auto implementaion
12 | Car car1 = new Car("hummer");
13 | Console.WriteLine(car1.Model);
14 | car1.Model = "mclaren";
15 | Console.WriteLine(car1.Model);
16 | }
17 | }
18 | public class Car
19 | {
20 | private int speed;
21 | public Car(int speed)
22 | {
23 | this.speed = speed;
24 | }
25 | public int Speed
26 | {
27 | get { return speed; }
28 | set
29 | {
30 | if (value > 3000)
31 |
32 | speed = 300;
33 | else
34 | speed = value;
35 | }
36 | }
37 | public string Model { get; set; }//auto implementaion => mainly used in if there is no logic required
38 | public Car(string model)
39 | {
40 | this.Model = model;
41 | }
42 |
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/gettersandsetters/gettersandsetters/gettersandsetters.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/hashset/hashset.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "hashset", "hashset\hashset.csproj", "{91A5ABCE-50A1-4629-A06A-B2A91699075B}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {91A5ABCE-50A1-4629-A06A-B2A91699075B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {91A5ABCE-50A1-4629-A06A-B2A91699075B}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {91A5ABCE-50A1-4629-A06A-B2A91699075B}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {91A5ABCE-50A1-4629-A06A-B2A91699075B}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {7D515A12-09CA-4D13-B77F-18AB70F4639F}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/hashset/hashset/Program.cs:
--------------------------------------------------------------------------------
1 | namespace hashset
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | HashSet set = new HashSet() { "salih","salih","fasal"};
8 | List list = new List() { 1,2};
9 | Console.WriteLine(String.Join(", ",set));
10 | set.Add("priya");
11 | Console.WriteLine(String.Join(", ", set));
12 |
13 | Console.WriteLine(String.Join(", ", set)+" empty");
14 | Dictionary d=new Dictionary();
15 | for(int i = 0; i < set.Count; i++)
16 | {
17 | d.Add(list[i], set.ElementAt(i));
18 | }
19 | Console.WriteLine(String.Join(", ",d));
20 | set.Clear();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/hashset/hashset/hashset.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/hashsetAndListandEnum/hashsetAndListandEnum.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "hashsetAndListandEnum", "hashsetAndListandEnum\hashsetAndListandEnum.csproj", "{C33628E5-2F93-4509-A9CA-2E05E30827F3}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {C33628E5-2F93-4509-A9CA-2E05E30827F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {C33628E5-2F93-4509-A9CA-2E05E30827F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {C33628E5-2F93-4509-A9CA-2E05E30827F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {C33628E5-2F93-4509-A9CA-2E05E30827F3}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {28DD6640-ECE0-4618-B7A8-43F14D517C5C}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/hashsetAndListandEnum/hashsetAndListandEnum/Program.cs:
--------------------------------------------------------------------------------
1 | namespace hashsetAndListandEnum
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | HashSet ha = new HashSet();
8 | ha.Add(1);
9 | ha.Add(2);
10 | ha.Add(3);
11 | int[] a = new int[3] { 1, 2, 3 };
12 | //a[-1] = 4;
13 | //Console.WriteLine(a[-1]);
14 | foreach (var item in ha)
15 | {
16 | Console.WriteLine(item);
17 | }
18 | ha.Remove(1);
19 | foreach (var item in ha)
20 | {
21 | Console.WriteLine(item);
22 | }
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/hashsetAndListandEnum/hashsetAndListandEnum/hashsetAndListandEnum.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/hello wor;ld/hello wor;ld.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "hello wor;ld", "hello wor;ld\hello wor;ld.csproj", "{0AFDC677-30AB-4DDA-83F5-A39B274CBA62}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {0AFDC677-30AB-4DDA-83F5-A39B274CBA62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {0AFDC677-30AB-4DDA-83F5-A39B274CBA62}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {0AFDC677-30AB-4DDA-83F5-A39B274CBA62}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {0AFDC677-30AB-4DDA-83F5-A39B274CBA62}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {2677975B-A6DC-4710-B852-BA383E088442}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/hello wor;ld/hello wor;ld/Program.cs:
--------------------------------------------------------------------------------
1 | namespace hello_wor_ld
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | Random rnd = new Random();
8 | int month = rnd.Next(1, 13); // creates a number between 1 and 12
9 | int dice = rnd.Next(1, 7); // creates a number between 1 and 6
10 | int card = rnd.Next(52); // creates a number between 0 and 51
11 | Console.WriteLine(value: card);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/hello wor;ld/hello wor;ld/hello wor;ld.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | hello_wor_ld
7 | enable
8 | enable
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/helloworld/helloworld.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "helloworld", "helloworld\helloworld.csproj", "{1F1DC64E-39B7-4A99-8965-8447254F484C}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {1F1DC64E-39B7-4A99-8965-8447254F484C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {1F1DC64E-39B7-4A99-8965-8447254F484C}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {1F1DC64E-39B7-4A99-8965-8447254F484C}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {1F1DC64E-39B7-4A99-8965-8447254F484C}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {0E1911FA-BDF2-4646-A69C-25C60E4D293B}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/helloworld/helloworld/Program.cs:
--------------------------------------------------------------------------------
1 |
2 |
3 | namespace helloworld
4 | {
5 | internal class Program
6 | {
7 | static void Main(string[] args)
8 | {
9 | Console.WriteLine("enter name!");
10 | String? name=Console.ReadLine();
11 | Console.WriteLine(name);
12 | for (int i = 0; i < 10; i++) {
13 | Console.WriteLine(i);
14 | }
15 | Console.WriteLine(name.ToUpper());
16 | Console.WriteLine(name.ToLower());
17 | Console.WriteLine(name.Length);
18 |
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/helloworld/helloworld/helloworld.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/inheritence/inheritence.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "inheritence", "inheritence\inheritence.csproj", "{15E69776-E7D9-4C82-B7F2-37F49AC673B3}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {15E69776-E7D9-4C82-B7F2-37F49AC673B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {15E69776-E7D9-4C82-B7F2-37F49AC673B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {15E69776-E7D9-4C82-B7F2-37F49AC673B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {15E69776-E7D9-4C82-B7F2-37F49AC673B3}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {E852DB4B-CBE2-4131-89E8-046C5B8FDCFA}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/inheritence/inheritence/Program.cs:
--------------------------------------------------------------------------------
1 | namespace inheritence
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | Calculate calculate = new Calculate();
8 | Console.WriteLine(calculate.sum(10));
9 | calculate.Hello();
10 | bool b = false;
11 | if (b)
12 | {
13 | Console.WriteLine("true");
14 |
15 | }else if (!b)
16 | {
17 | Console.WriteLine("false");
18 | }
19 | }
20 | }
21 | public interface Ihello
22 | {
23 | void Hello();
24 | int sum(int x);
25 | }
26 | public class Calculate:Ihello
27 | {
28 | public int sum(int x)
29 | {
30 | return x * 2;
31 | }
32 | public void Hello()
33 | {
34 | Console.WriteLine("COMPLETED");
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/inheritence/inheritence/inheritence.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/interfaceExample/interfaceExample.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "interfaceExample", "interfaceExample\interfaceExample.csproj", "{82BF3A2C-B645-4F7F-9D5F-0488DB1C9081}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {82BF3A2C-B645-4F7F-9D5F-0488DB1C9081}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {82BF3A2C-B645-4F7F-9D5F-0488DB1C9081}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {82BF3A2C-B645-4F7F-9D5F-0488DB1C9081}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {82BF3A2C-B645-4F7F-9D5F-0488DB1C9081}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {13EB4609-C12C-40AC-A97D-1457F1B9AB12}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/interfaceExample/interfaceExample/Program.cs:
--------------------------------------------------------------------------------
1 | namespace interfaceExample
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | Egofinterface i = new Egofinterface();
8 | Egofinterface1 i1 = new Egofinterface1();
9 | i.message();
10 | i1.message();
11 | i1.message1();
12 | }
13 |
14 |
15 |
16 | }
17 | //interface
18 | interface IExample
19 | {
20 | void message();
21 | }
22 | interface IExample1
23 | {
24 | void message1();
25 | }
26 | // implement interface
27 | public class Egofinterface : IExample
28 | {
29 | public void message()
30 | {
31 | Console.WriteLine("hii salu mon");
32 | }
33 | }
34 | //mulltiiple inheritance via interface
35 | public class Egofinterface1 : IExample, IExample1
36 | {
37 | public void message()
38 | {
39 | Console.WriteLine("mulltiiple inheritance via interface ");
40 | }
41 | public void message1()
42 | {
43 | Console.WriteLine("mulltiiple inheritance via interface ");
44 | }
45 |
46 |
47 | }
48 | }
--------------------------------------------------------------------------------
/interfaceExample/interfaceExample/interfaceExample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/jaggedarray/jaggedarray.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "jaggedarray", "jaggedarray\jaggedarray.csproj", "{D56D5BCE-5B75-4C31-83DB-3C12921A3970}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {D56D5BCE-5B75-4C31-83DB-3C12921A3970}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {D56D5BCE-5B75-4C31-83DB-3C12921A3970}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {D56D5BCE-5B75-4C31-83DB-3C12921A3970}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {D56D5BCE-5B75-4C31-83DB-3C12921A3970}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {6C558C37-FFAC-4B7C-893C-2941B241EDCF}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/jaggedarray/jaggedarray/Program.cs:
--------------------------------------------------------------------------------
1 | namespace jaggedarray
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | //jagged array
8 | int[][] arr =new int[3][];
9 | arr[0]=new int[] {1,2,3};
10 | arr[1] = new int[] { 1, 3 };
11 | arr[2] = new int[] { 1, 2, 3, 40 };
12 | //Console.WriteLine(arr.Length);
13 | arr[1][1] = 7;
14 | for (int i = 0; i < arr.Length; i++)
15 | {
16 | Console.WriteLine();
17 | for(int j = 0; j < arr[i].Length; j++)
18 | {
19 | Console.Write(arr[i][j] + " ");
20 | }
21 | }
22 | //jagges array with multidiamensional
23 | int[][,] arr2 =
24 | {
25 | new int[][,]{{1,2,30},{1,2,3}}
26 | }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/jaggedarray/jaggedarray/jaggedarray.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/leecode796/leecode796.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "leecode796", "leecode796\leecode796.csproj", "{70BC77CB-69E2-4C89-BD27-14CE5DAA601F}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {70BC77CB-69E2-4C89-BD27-14CE5DAA601F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {70BC77CB-69E2-4C89-BD27-14CE5DAA601F}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {70BC77CB-69E2-4C89-BD27-14CE5DAA601F}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {70BC77CB-69E2-4C89-BD27-14CE5DAA601F}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {D33BCF10-D554-441E-8B59-64382BCFDFC2}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/leecode796/leecode796/Program.cs:
--------------------------------------------------------------------------------
1 | namespace leecode796
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | Console.WriteLine(RotateString("abcde","bcdea"));
8 |
9 | }
10 | public static bool RotateString(string s, string goal)
11 | {
12 | int count = 0;
13 | while (count < s.Length)
14 | {
15 | if (s == goal) return true;
16 | s = s.Substring(1) + s[0];
17 | count++;
18 | }
19 | return false;
20 | }
21 | }
22 | }
23 |
24 |
--------------------------------------------------------------------------------
/leecode796/leecode796/leecode796.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/leetCode-167/leetCode-167.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "leetCode-167", "leetCode-167\leetCode-167.csproj", "{7A10F02B-41EF-47FB-86C9-6B2477B70C59}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {7A10F02B-41EF-47FB-86C9-6B2477B70C59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {7A10F02B-41EF-47FB-86C9-6B2477B70C59}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {7A10F02B-41EF-47FB-86C9-6B2477B70C59}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {7A10F02B-41EF-47FB-86C9-6B2477B70C59}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {73D66309-901E-4D91-B963-5CF39711197F}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/leetCode-167/leetCode-167/Program.cs:
--------------------------------------------------------------------------------
1 | namespace leetCode_167
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | int[] arr = { 2, 7, 11, 15 };
8 | Console.WriteLine(string.Join(", ", TwoSum(arr, 9)));
9 |
10 | }
11 | public static int[] TwoSum(int[] numbers, int target)
12 | {
13 | int left = 0, right = numbers.Length - 1;
14 | while (left < right)
15 | {
16 | int sum = numbers[left] + numbers[right];
17 | if (sum == target)
18 | {
19 | return new int[] { left + 1, right + 1 }; ;
20 | }
21 | else if (sum < target)
22 | {
23 | left++;
24 | }
25 | else
26 | {
27 | right--;
28 | }
29 | }
30 | return Array.Empty();
31 | ;
32 | }
33 | }
34 | }
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/leetCode-167/leetCode-167/leetCode-167.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | leetCode_167
7 | enable
8 | enable
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/leetcode-qst-2914/leetcode-qst-2914.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "leetcode-qst-2914", "leetcode-qst-2914\leetcode-qst-2914.csproj", "{9CE787CF-9089-4262-9D16-2AED0D81B083}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {9CE787CF-9089-4262-9D16-2AED0D81B083}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {9CE787CF-9089-4262-9D16-2AED0D81B083}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {9CE787CF-9089-4262-9D16-2AED0D81B083}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {9CE787CF-9089-4262-9D16-2AED0D81B083}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {B8ED3280-6E6B-450F-BB21-AA9AD9F2A425}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/leetcode-qst-2914/leetcode-qst-2914/Program.cs:
--------------------------------------------------------------------------------
1 | namespace leetcode_qst_2914
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | Console.WriteLine(MinChanges("1001"));
8 | }
9 |
10 | public static int MinChanges(string s)
11 | {
12 | int count = 0;
13 | for (int i = 1; i < s.Length; i += 2)
14 | {
15 | if (s[i] != s[i - 1])
16 | {
17 | count++;
18 | }
19 | }
20 | return count;
21 | }
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/leetcode-qst-2914/leetcode-qst-2914/leetcode-qst-2914.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | leetcode_qst_2914
7 | enable
8 | enable
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/leetcode2180/leetcode2180.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "leetcode2180", "leetcode2180\leetcode2180.csproj", "{E5590294-CBED-411F-9910-853B8227E989}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {E5590294-CBED-411F-9910-853B8227E989}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {E5590294-CBED-411F-9910-853B8227E989}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {E5590294-CBED-411F-9910-853B8227E989}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {E5590294-CBED-411F-9910-853B8227E989}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {0A4E1E2C-7D0D-4275-B8A2-36A1C27B41A8}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/leetcode2180/leetcode2180/Program.cs:
--------------------------------------------------------------------------------
1 | namespace leetcode2180
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | Console.WriteLine(CountEven(30));
8 | }
9 | public static int CountEven(int num)
10 | {
11 | int count = 0;
12 | for (int i = 1; i <= num; i++)
13 | {
14 | string arr = i.ToString();
15 | int sum = 0;
16 | foreach (char item in arr)
17 | {
18 | sum += int.Parse(item.ToString());
19 | }
20 | if (sum % 2 == 0)
21 | {
22 | count++;
23 | }
24 | }
25 | return count;
26 | }
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/leetcode2180/leetcode2180/leetcode2180.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/leetcode3289/leetcode3289.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "leetcode3289", "leetcode3289\leetcode3289.csproj", "{511AF189-0FF5-4E96-A32E-0CF9428EAEF5}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {511AF189-0FF5-4E96-A32E-0CF9428EAEF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {511AF189-0FF5-4E96-A32E-0CF9428EAEF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {511AF189-0FF5-4E96-A32E-0CF9428EAEF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {511AF189-0FF5-4E96-A32E-0CF9428EAEF5}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {1CF02608-C90C-4A7C-B305-F487479527B3}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/leetcode3289/leetcode3289/Program.cs:
--------------------------------------------------------------------------------
1 | namespace leetcode3289
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | Console.WriteLine(GetSneakyNumbers([0,1,1,0]));
8 | }
9 | public static int[] GetSneakyNumbers(int[] nums)
10 | {
11 | List result = new List();
12 |
13 | for (int i = 0; i < nums.Length; i++)
14 | {
15 | int count = 0;
16 | for (int j = 0; j < nums.Length; j++)
17 | {
18 | if (nums[i] == nums[j] && i != j)
19 | {
20 | count++;
21 | }
22 | }
23 | if (count == 1)
24 | {
25 | if (!result.Contains(nums[i]))
26 | {
27 | result.Add(nums[i]);
28 | }
29 | }
30 | }
31 |
32 | return result.ToArray();
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/leetcode3289/leetcode3289/leetcode3289.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/leetcodeSolving/leetcodeSolving.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "leetcodeSolving", "leetcodeSolving\leetcodeSolving.csproj", "{F704E1FD-B9B4-43F0-B0F3-525C3E998C66}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {F704E1FD-B9B4-43F0-B0F3-525C3E998C66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {F704E1FD-B9B4-43F0-B0F3-525C3E998C66}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {F704E1FD-B9B4-43F0-B0F3-525C3E998C66}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {F704E1FD-B9B4-43F0-B0F3-525C3E998C66}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {6A94F73A-66B0-4020-91D6-9D6A6591184B}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/leetcodeSolving/leetcodeSolving/Program.cs:
--------------------------------------------------------------------------------
1 | namespace leetcodeSolving
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | Console.WriteLine(TruncateSentence("Hello how are you Contestant", 4));
8 | string text = "applebanancherry";
9 | //string[] fruits = text.Split(' ');
10 | //foreach (string fruit in fruits )
11 | //{
12 | // Console.WriteLine( fruit );
13 | //}
14 | int result = NumberOfSteps(8);
15 | Console.WriteLine(result);
16 | }
17 |
18 | //leet code qst :1816. Truncate Sentence
19 | public static string TruncateSentence(string s, int k)
20 | {
21 | string result = "";
22 | string[] str = s.Split(' ');
23 | for (int i = 0; i < k; i++)
24 | {
25 |
26 | result += str[i]+" ";
27 | }
28 | return result.TrimEnd();
29 | }
30 | //1342. Number of Steps to Reduce a Number to Zero
31 | public static int NumberOfSteps(int num)
32 | {
33 | int step = 0;
34 | while (num > 0)
35 | {
36 | if(num % 2 == 0)
37 | {
38 | num /= 2;
39 | }
40 | else
41 | {
42 | num-= 1;
43 | }
44 |
45 | step++;
46 | }
47 |
48 | return step;
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/leetcodeSolving/leetcodeSolving/leetcodeSolving.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/linqInCSharpBasic/linqInCSharpBasic.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "linqInCSharpBasic", "linqInCSharpBasic\linqInCSharpBasic.csproj", "{6C4420AC-8B7D-4138-A9CE-E25C198E2F66}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {6C4420AC-8B7D-4138-A9CE-E25C198E2F66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {6C4420AC-8B7D-4138-A9CE-E25C198E2F66}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {6C4420AC-8B7D-4138-A9CE-E25C198E2F66}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {6C4420AC-8B7D-4138-A9CE-E25C198E2F66}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {01B7A6E8-A7F1-41C3-AA04-FEC3DB1E2EBB}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/linqInCSharpBasic/linqInCSharpBasic/Program.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace linqInCSharpBasic
5 | {
6 | internal class Program
7 | {
8 | static void Main(string[] args)
9 | {
10 | List list = new List() { 3, 4, 1, 2, 5,6 };
11 | var evenumbers = from num in list
12 | where num % 2 == 0
13 | select num;
14 | foreach(var num in evenumbers)
15 | {
16 | Console.WriteLine(num);
17 | }
18 | //int a = 10;
19 | //double b = 20;\
20 | //int c =Convert.ToInt32(a + b);
21 | //Console.WriteLine(a + b);
22 | //using parse
23 | string numberstr = "123";
24 | int number = int.Parse(numberstr);
25 | Console.WriteLine(number);
26 | // using tryparse
27 | string sttr = "12cd";
28 | bool result=int.TryParse(sttr, out int numb);
29 | Console.WriteLine(result? numb : null);
30 | var ascend=from num in list
31 | orderby num ascending
32 | select num;
33 | foreach (var num in ascend)
34 | {
35 | Console.WriteLine(num);
36 | }
37 | //bool tr = false;
38 | //Console.WriteLine(tr);
39 | Dictionary dict = new Dictionary() ;
40 | dict.Add(1, "salih");
41 | foreach (var num in dict)
42 | {
43 | Console.WriteLine(num);
44 | }
45 | foreach (char s in dict[1])
46 | {
47 | Console.WriteLine(s);
48 | }
49 | //var dictOfLists = new Dictionary>();
50 |
51 | var dic =new Dictionary>() ;
52 | dic[1]=new List() { 1,2,3};
53 | dic[1] = new List() { 1, 2, 3 };
54 | dic[1] = new List() { 1, 2, 3 };
55 | Console.WriteLine("dictionary of list");
56 | foreach(var num in dic)
57 | {
58 | //Console.WriteLine("key :{0}",num.Key);
59 | Console.WriteLine($"key :{num.Key}");
60 |
61 | }
62 | var re = from num in dic
63 | where num.Key == 1
64 | select num;
65 | Console.WriteLine(re.GetType());
66 | //foreach (var num in re)
67 | //{
68 | // foreach (var num2 in num.Value)
69 | // {
70 | // Console.WriteLine(num2);
71 | // }
72 | //}
73 | var njn = 10;
74 | Console.WriteLine(njn.GetType());//int32
75 | List list1=new List() { 1,2,3,4,5,6};
76 | foreach (var item in list1)
77 | {
78 |
79 | Console.WriteLine(item);
80 | }
81 | Console.WriteLine("parralel foreach");
82 | //parralel foreach
83 | Parallel.ForEach(list1, x =>
84 | {
85 | Console.WriteLine(x);
86 | });
87 | Console.ReadKey();
88 |
89 | }
90 |
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/linqInCSharpBasic/linqInCSharpBasic/linqInCSharpBasic.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/linqeg4/linqeg4.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "linqeg4", "linqeg4\linqeg4.csproj", "{6AA797DB-F314-4C67-9AD1-E76E752CBCA8}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {6AA797DB-F314-4C67-9AD1-E76E752CBCA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {6AA797DB-F314-4C67-9AD1-E76E752CBCA8}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {6AA797DB-F314-4C67-9AD1-E76E752CBCA8}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {6AA797DB-F314-4C67-9AD1-E76E752CBCA8}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {F9D535C1-B93E-452D-BA86-544268D8E4A6}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/linqeg4/linqeg4/Program.cs:
--------------------------------------------------------------------------------
1 | namespace linqeg4
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | List list = new List() { 1,2,3,4,5,6,7};
8 | var res=list.Where(x=>x%2==0);
9 |
10 | Console.WriteLine(String.Join(", ",res));
11 | var numbers = new List { 1, 2, 3, 4, 5, 6 };
12 | //query synntax
13 | var a = from n in numbers
14 | where n % 2 == 0
15 | select n;
16 | Console.WriteLine(String.Join(", ", a));
17 | int[] arr = { 1, 2, 3,4,5,6,7,8,9};
18 | list.Clear();
19 | foreach(int x in arr)
20 | {
21 | if(x%2==0)
22 | list.Add(x);
23 | }
24 | var sorted= list.OrderByDescending(x=>x);
25 | Console.WriteLine(String.Join(", ",sorted));
26 | var grouped=numbers.GroupBy(x=>x%2==0?"even":"odd");
27 | foreach(var x in grouped)
28 | {
29 | Console.WriteLine($"{x.Key} : {String.Join(", ",x)}");
30 | }
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/linqeg4/linqeg4/linqeg4.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/lissteg/lissteg.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "lissteg", "lissteg\lissteg.csproj", "{F0387ADE-D72A-434D-BB61-1C0A64D0ED72}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {F0387ADE-D72A-434D-BB61-1C0A64D0ED72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {F0387ADE-D72A-434D-BB61-1C0A64D0ED72}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {F0387ADE-D72A-434D-BB61-1C0A64D0ED72}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {F0387ADE-D72A-434D-BB61-1C0A64D0ED72}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {52CDB681-D0FD-4E06-A9EB-C21EE6093720}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/lissteg/lissteg/Program.cs:
--------------------------------------------------------------------------------
1 | namespace lissteg
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | List list = new List();
8 | List list1 = new List();
9 | list.Add("salih");
10 | list.Add("fasal");
11 | foreach (var item in list)
12 | {
13 | Console.WriteLine(item);
14 | }
15 | list.Remove("fasal");
16 | Console.WriteLine(String.Join(", ", list));
17 | for(int i = 1; i < 3; i++)
18 | {
19 | list1.Add(i);
20 | }
21 | Console.WriteLine(list1.Contains(2));
22 | list.Union(list);
23 | Console.WriteLine(String.Join(',',list));
24 |
25 |
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/lissteg/lissteg/lissteg.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/methodOverriding/methodOverriding.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "methodOverriding", "methodOverriding\methodOverriding.csproj", "{9E373F1A-18FB-4055-9601-3F1E4130BA17}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {9E373F1A-18FB-4055-9601-3F1E4130BA17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {9E373F1A-18FB-4055-9601-3F1E4130BA17}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {9E373F1A-18FB-4055-9601-3F1E4130BA17}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {9E373F1A-18FB-4055-9601-3F1E4130BA17}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {6E2ED8A7-2046-4777-BEF6-97D241A68096}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/methodOverriding/methodOverriding/Program.cs:
--------------------------------------------------------------------------------
1 | namespace methodOverriding
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | Dog dog = new Dog();
8 | Cat cat = new Cat();
9 | dog.speak();
10 | cat.speak();
11 | Console.WriteLine(dog.ToString());
12 | }
13 | }
14 | public class Animal
15 | {
16 | public virtual void speak()
17 | {
18 | Console.WriteLine("brrr");
19 | }
20 | }
21 | public class Dog:Animal
22 | {
23 | public override void speak()
24 | {
25 | Console.WriteLine("bow bow");
26 | }
27 | public override string ToString()
28 | {
29 | return "dog kurachu bow bow bow";
30 | }
31 |
32 | }
33 | public class Cat : Animal
34 | {
35 | public override void speak()
36 | {
37 | Console.WriteLine("meow meow");
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/methodOverriding/methodOverriding/methodOverriding.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/string/string.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "string", "string\string.csproj", "{A42921CE-0A98-4837-8B7E-0A5A1D770028}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {A42921CE-0A98-4837-8B7E-0A5A1D770028}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {A42921CE-0A98-4837-8B7E-0A5A1D770028}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {A42921CE-0A98-4837-8B7E-0A5A1D770028}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {A42921CE-0A98-4837-8B7E-0A5A1D770028}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {8899DEFD-17C2-4191-8FC1-33ACCF5F4314}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/string/string/Program.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 |
3 | namespace stringg;
4 |
5 | internal class Program
6 | {
7 | static void Main(string[] args)
8 | {
9 | string str = "salu mon";
10 | string[] str2 =str.Split(' ');
11 | foreach(string i in str2)
12 | Console.WriteLine(i);
13 | string str3 = str.Substring(3, 3);
14 | Console.WriteLine(str3);
15 | bool contains=str.Contains("salu");
16 | Console.WriteLine(contains);
17 | //string interpolation
18 | Console.WriteLine($"hii {str}");
19 | Console.WriteLine($"hii {str,10}");
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/string/string/string.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/strucEg/strucEg.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "strucEg", "strucEg\strucEg.csproj", "{DDB3E983-CE36-43FD-8B3E-D7625122ACC9}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {DDB3E983-CE36-43FD-8B3E-D7625122ACC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {DDB3E983-CE36-43FD-8B3E-D7625122ACC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {DDB3E983-CE36-43FD-8B3E-D7625122ACC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {DDB3E983-CE36-43FD-8B3E-D7625122ACC9}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {8BD28C73-6FEE-4DA7-9180-E0F47EFE3E43}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/strucEg/strucEg/Program.cs:
--------------------------------------------------------------------------------
1 | namespace strucEg
2 | {
3 | internal class Program
4 | {
5 | struct Student
6 | {
7 | public int Id;
8 | public string Name;
9 | }
10 | static void Main(string[] args)
11 | {
12 | Student student;
13 | student.Id = 10;
14 | student.Name = 10+" ejdcnewj";
15 | Console.WriteLine(student.Name);
16 | object obj = student.Name;
17 | Console.WriteLine(obj);
18 | string hello = "hello";
19 | hello = "j";
20 | Console.WriteLine(hello);
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/strucEg/strucEg/strucEg.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/struct/struct.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "struct", "struct\struct.csproj", "{4E7D7394-1BA5-4636-8880-71AB465A51C8}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {4E7D7394-1BA5-4636-8880-71AB465A51C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {4E7D7394-1BA5-4636-8880-71AB465A51C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {4E7D7394-1BA5-4636-8880-71AB465A51C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {4E7D7394-1BA5-4636-8880-71AB465A51C8}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {4B8747B6-11C2-42D3-A247-A3E80C38FCC3}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/struct/struct/Program.cs:
--------------------------------------------------------------------------------
1 | namespace internal struct;
2 |
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | Console.WriteLine("Hello, World!");
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/struct/struct/struct.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/structInCsharp/structInCsharp.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "structInCsharp", "structInCsharp\structInCsharp.csproj", "{0D9931F7-7624-4086-950A-72C8E57C8460}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {0D9931F7-7624-4086-950A-72C8E57C8460}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {0D9931F7-7624-4086-950A-72C8E57C8460}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {0D9931F7-7624-4086-950A-72C8E57C8460}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {0D9931F7-7624-4086-950A-72C8E57C8460}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {EB8D2F38-5310-4181-8274-CE0127654686}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/structInCsharp/structInCsharp/Program.cs:
--------------------------------------------------------------------------------
1 | namespace structInCsharp
2 | {
3 | internal class Program
4 | {
5 | struct Student
6 | {
7 | public string name;
8 | public int mark;
9 | public void display()
10 | {
11 | Console.WriteLine($"name {name} mark {mark}");
12 | }
13 | }
14 | struct Employee
15 | {
16 | public string name;
17 | public int id;
18 | public Employee(string name, int id)
19 | {
20 | this.name = name;
21 | this.id = id;
22 | }
23 | public void greet()
24 | {
25 | Console.WriteLine($"hii {name} ur id is {id}");
26 | }
27 | }
28 | static void Main(string[] args)
29 | {
30 | Student s1;
31 | s1.name = "salih";
32 | s1.mark = 100;
33 | s1.display();
34 | Employee employee = new Employee("salih",22);
35 | employee.greet();
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/structInCsharp/structInCsharp/structInCsharp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/threadinCsharp/threadinCsharp.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.11.35208.52
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "threadinCsharp", "threadinCsharp\threadinCsharp.csproj", "{9EF7A6A9-C4D5-4ED5-93C6-417FA1FB136E}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {9EF7A6A9-C4D5-4ED5-93C6-417FA1FB136E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {9EF7A6A9-C4D5-4ED5-93C6-417FA1FB136E}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {9EF7A6A9-C4D5-4ED5-93C6-417FA1FB136E}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {9EF7A6A9-C4D5-4ED5-93C6-417FA1FB136E}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {0311AB9B-638F-4152-A4E8-42A6546EF988}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/threadinCsharp/threadinCsharp/Program.cs:
--------------------------------------------------------------------------------
1 | namespace threadinCsharp
2 | {
3 | internal class Program
4 | {
5 | static void Main(string[] args)
6 | {
7 | Thread thread=Thread.CurrentThread;
8 | //Thread thread1 = new Thread(countup);
9 | Thread thread2 = new Thread(countup);
10 | Thread thread1 = new Thread(()=>countdown("counter down"));//suppose we need to pass parameter
11 | thread.Name = "main thread";
12 | //countup();
13 | //countdown();
14 | thread1.Start();
15 | thread2.Start();
16 | Console.WriteLine($"{thread.Name} completed");
17 | }
18 | public static void countup()
19 | {
20 | for(int i = 0; i <= 10; i++)
21 | {
22 | Console.WriteLine($"counter up {i} seconds");
23 | Thread.Sleep(1000);
24 | }
25 | }
26 | public static void countdown(string countername)
27 | {
28 | for (int i = 10; i >= 0; i--)
29 | {
30 | Console.WriteLine($"{countername} {i} seconds");
31 | Thread.Sleep(1000);
32 | }
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/threadinCsharp/threadinCsharp/threadinCsharp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------