-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Player
authored and
Player
committed
Sep 14, 2016
1 parent
a09c1b3
commit 8c8fb4f
Showing
12 changed files
with
225 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "C++ Launch", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"program": "enter program name, for example ${workspaceRoot}/a.out", | ||
"args": [], | ||
"stopAtEntry": false, | ||
"cwd": "${workspaceRoot}", | ||
"environment": [], | ||
"externalConsole": true, | ||
"linux": { | ||
"MIMode": "gdb" | ||
}, | ||
"osx": { | ||
"MIMode": "lldb" | ||
}, | ||
"windows": { | ||
"MIMode": "gdb" | ||
} | ||
}, | ||
{ | ||
"name": "C++ Attach", | ||
"type": "cppdbg", | ||
"request": "attach", | ||
"program": "enter program name, for example ${workspaceRoot}/a.out", | ||
"processId": "${command.pickProcess}", | ||
"linux": { | ||
"MIMode": "gdb" | ||
}, | ||
"osx": { | ||
"MIMode": "lldb" | ||
}, | ||
"windows": { | ||
"MIMode": "gdb" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include<stdio.h> | ||
void hello_world(void) | ||
{ | ||
printf("Hello World!\n"); | ||
} | ||
|
||
void three_hellos(void) | ||
{ | ||
int counter; | ||
for(counter=1;counter<=3;counter++) | ||
hello_world(); | ||
} | ||
|
||
int main(void) | ||
{ | ||
three_hellos(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include <stdio.h> | ||
|
||
int main(int argc, char *argv[]) { | ||
int len=0; | ||
char *p=s; | ||
while(*p!=0) | ||
{ | ||
len++; | ||
p++; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
using namespace std; | ||
int main(int argc, char *argv[]) { | ||
cout << "Size of char: " << sizeof(char) << endl; | ||
cout << "Size of int: " << sizeof(int) << endl; | ||
cout << "Size of chort int: " << sizeof(short int) << endl; | ||
cout << "Size of long int:" << sizeof(long int) << endl; | ||
cout << "Size of float: " << sizeof(float) << endl; | ||
cout << "Size of double: " << sizeof(double) << endl; | ||
cout << "Size of wchar_t : " << sizeof(wchar_t) << endl; | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <iostream> | ||
|
||
using namespace std; | ||
extern int a,b; | ||
extern int c; | ||
extern float f; | ||
|
||
int main(int argc, char *argv[]) { | ||
int a,b; | ||
int c; | ||
float f; | ||
|
||
a=10; | ||
b=20; | ||
c=a+b; | ||
cout << c << endl; | ||
f=70.0/3.0; | ||
cout << f << endl; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <iostream> | ||
|
||
using namespace std; | ||
int main(int argc, char *argv[]) { | ||
cout << "Hello\tWorld\n\n"; | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#include <iostream> | ||
|
||
using namespace std; | ||
|
||
class Box | ||
{ | ||
public: | ||
double length; | ||
double breadth; | ||
double height; | ||
/* double getVolume(void){ | ||
return length*breadth*height; | ||
}*/ | ||
|
||
double getVolume(void); | ||
void setLength(double len); | ||
void setBreadth(double bre); | ||
void setHeight(double hei); | ||
}; | ||
|
||
double Box::getVolume(void) | ||
{ | ||
return length * height * breadth; | ||
} | ||
|
||
double Box::setLength(double len) | ||
{ | ||
length = len; | ||
} | ||
|
||
double Box::setBreadth(double bre) | ||
{ | ||
breadth = bre; | ||
} | ||
|
||
double Box::setHeight(double hei) | ||
{ | ||
height = hei; | ||
} | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
/* Box Box1; | ||
Box Box2; | ||
double volume = 0.0; | ||
Box1.height = 5.0; | ||
Box1.length = 6.0; | ||
Box1.breadth = 7.0; | ||
Box2.height = 10.0; | ||
Box2.length = 12.0; | ||
Box2.breadth = 13.0; | ||
volume = Box1.height * Box1.length * Box1.breadth; | ||
cout << "Box1's volume: " << volume << endl; | ||
volume = Box2.height * Box2.length * Box2.breadth; | ||
cout << "Box2's volume: " << volume << endl; | ||
*/ | ||
Box Box1 ; | ||
Box Box2; | ||
double volume; | ||
|
||
Box1.setLength(6.0); | ||
Box1.setHeight(5.0); | ||
Box1.setBreadth(7.0); | ||
|
||
Box2.setLength(12.0); | ||
Box2.setBreadth(13.0); | ||
Box2.setHeight(10.0); | ||
|
||
volume=Box1.getVolume(); | ||
cout << "Box1's volume is :" << volume << endl; | ||
|
||
volume = Box2.getVolume(); | ||
cout << "Box2's volume is :" << volume << endl; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include <iostream> | ||
|
||
using namespace std; | ||
|
||
class Line | ||
{ | ||
public: | ||
double length; | ||
void setLength(double len); | ||
doubel getLength; | ||
}; | ||
|
||
double Line::getLength(void) | ||
{ | ||
return length; | ||
} | ||
|
||
void Line::setLength(double len) | ||
{ | ||
length=len; | ||
} | ||
|
||
int main(int argc, char *argv[]) { | ||
Line line; | ||
|
||
line.setLength(6.0); | ||
|
||
cout << "Length of line :" << line.length << endl; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include <iostream> | ||
|
||
using namespace std; |