forked from bilal255/linkedList
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
83 lines (65 loc) · 1.5 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include<iostream>
#include<fstream>
#include"nodeClass.cpp"
#include"linkList.cpp"
using namespace std;
int main() {
//File Handling variables
ifstream inData;
ofstream oData;
//Declaring List objects
cList list,readList;
//Node List
cNode *n[5];
//Putting Random data in Node List
for (int i = 0; i < 5; ++i) {
n[i] = new cNode(i+5);
}
//Inserting nodes to cList object 'list'
for (int i = 0; i < 5; ++i) {
list.insert(n[i]);
}
cout << "\nPrinting List Data\n";
list.printList();
//Opening and Clsosing file to write LIST to file data.bin
oData.open("G:/uniBooksAndAssignments/3rdSemester/assignments/dsaTheory/linkedList/data.bin");
list.writeListToFile(oData);
oData.close();
//Opeining and Closing file to read LIST from file data.bin
inData.open("G:/uniBooksAndAssignments/3rdSemester/assignments/dsaTheory/linkedList/data.bin");
readList.readListFromFile(inData);
inData.close();
//Printing Read List from file
cout << "\nPrinting List Read from File\n";
readList.printList();
system("pause");
return 0;
}
#include <iostream>
#include<string.h>
#include<ctype.h>
#define MAX 20
using namespace std;
int main()
{
double number;
number=5.1;
cout <<number<<endl;
int size =sizeof(number);
cout<<size<<endl<<endl<<endl;
char name[MAX];
int x;
cout <<"enter name:"<<endl;
cin>>name;
for(int x;x<strlen(name);x++)
{
name[x]=tolower(name[x]);
}
cout<<endl<<name<<endl;
int v;
for(int v=20;v> 1;v--)
{
cout<<v<<endl;
}
return 0;
}