8000 CPPM Lab · sbccas/c-programming-tutorials@261279e · GitHub
[go: up one dir, main page]

Skip to content

Commit 261279e

Browse files
CPPM Lab
1 parent 96d22f8 commit 261279e

File tree

11 files changed

+76
-23
lines changed

11 files changed

+76
-23
lines changed

.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "(Windows) Launch",
5+
"type": "cppvsdbg",
6+
"request": "launch",
7+
"program": "enter program name, for example ${workspaceFolder}/a.exe",
8+
"args": [],
9+
"stopAtEntry": false,
10+
"cwd": "${fileDirname}",
11+
"environment": [],
12+
"console": "externalTerminal"
13+
}
14+
],
15+
"version": "2.0.0"
16+
}

.vscode/settings.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
"files.associations": {
33
"CP1DOWHI.C": "cpp",
44
"CP2FORDE.C": "cpp",
5-
"CP42ARRA.C": "cpp"
5+
"CP42ARRA.C": "cpp",
6+
"CP5A1.C": "cpp",
7+
"PAP79ARR.C": "cpp",
8+
"HELLO.C": "cpp",
9+
"CP4ST3.C": "cpp",
10+
"CP4WHILE.C": "cpp",
11+
"LP1NESTE.C": "cpp",
12+
"P1DEMORF.C": "cpp",
13+
"PAP47MEN.C": "cpp"
614
}
715
}

.vscode/tasks.json

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

3_Programs/CP42ARRA.exe

0 Bytes
Binary file not shown.

3_Programs/CP4ST3.C

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#include<stdio.h>
22
#include<conio.h>
3-
void main()
3+
int main()
44
{
55
int i,j,k,n,l;
66
n=8;
7-
clrscr();
7+
//clrscr();
88
for (i=1;i<=n;i++)
99
{
1010
for(j=8;j>=i;j--)
@@ -21,6 +21,6 @@ for (i=1;i<=n;i++)
2121

2222
printf("\n");
2323
}
24-
getch();
24+
//getch();
2525

2626
}

3_Programs/CP4ST3.exe

41.3 KB
Binary file not shown.

3_Programs/CP5A1.C

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
#include<stdio.h>
22
#include<conio.h>
3-
void main()
3+
int main()
44
{
5-
int i,fybca8[]={816,860};
6-
clrscr();
7-
// printf("STORING DATA IN 1-D ARRAY:\n");
8-
// for(i=0;i<5;i++)
9-
// {
10-
// printf("Please Enter your Data FYBCA8[%d]: \t",i);
11-
// scanf("%d",&fybca8[i]);
12-
// }
5+
int i,sum,fybca8[5]={0};
6+
sum=0;
7+
//clrscr();
8+
printf("STORING DATA IN 1-D ARRAY:\n");
9+
for(i=0;i<5;i++)
10+
{
11+
printf("Please Enter your Data FYBCA8[%d]: \t",i);
12+
scanf(" %d",&fybca8[i]);
13+
}
1314
printf("Data Stored Success\n");
14-
15-
16-
printf("\nPRINTING DATA IN 1-D ARRAY:\n");
17-
for(i=0;i<10;i++)
18-
printf("fybca8[%d]=%d\t",i,fybca8[i]);
19-
20-
getch();
15+
printf("\nSUM OF ALL THE ELEMENTS IN 1-D ARRAY:\n");
16+
for(i=0;i<5;i++)
17+
sum = sum + fybca8[i];
18+
19+
printf("SUM OF ALL ELEMENTS OF fybca8=%d\t",sum);
20+
return 0;
21+
//getch();
2122
}

3_Programs/CP5A1.exe

41.5 KB
Binary file not shown.

3_Programs/HELLO.exe

40.8 KB
Binary file not shown.

3_Programs/PAP79ARR.C

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ PAP 79.WAP TO SHOW DEMO OF 1 D ARRAY:
33
*/
44
#include <stdio.h>
55
#include <conio.h>
6-
void main()
6+
int main()
77
{
88
int fybca7[10],i;
9-
clrscr();
9+
//clrscr();
1010
printf("PROGRAM TO STORE DATA IN ARRAY:\n");
1111
for(i=0;i<10;i++)
1212
{
@@ -18,7 +18,7 @@ for(i=0;i<10;i++)
1818
{
1919
printf("ELEMENT AT fybca[%d]=%d\n",i,fybca7[i]);
2020
}
21-
getch();
21+
//getch();
2222

2323

2424
}

0 commit comments

Comments
 (0)
0