├── LICENSE ├── Mini Projects ├── ATM │ └── ATM_System.c ├── Bank │ └── Bank_Management_System.c ├── Calendar │ └── Calendar.c ├── Digital Clock │ └── Digital_Clock.c ├── KBC Quiz bot │ └── KBC_Quiz_Bot.c ├── Library Management System │ └── Library_Management_System.c ├── MS Word │ └── MS_Word.c ├── Media Player │ └── Media_Player.c ├── Password Generator │ └── Password_Generator.c ├── Smart Age Calculator │ └── Smart_Age_Calculator.c ├── Text to Binary Converter │ └── Text_To_Binary_Converter.c └── Tic Tac Toe │ └── Tic_Tac_Toe.c └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 SATYAM TRIPATHI 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Mini Projects/ATM/ATM_System.c: -------------------------------------------------------------------------------- 1 | // Note: Try to Run this Code on DEV-C++ IDE 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | float amount = 0.00; 10 | int deposit, withdraw, satyam; 11 | int choice, pin, k, g, s, yt; 12 | char ch, pass[100]; 13 | char transaction = 'y'; 14 | char f[100] = {"###### welcome to atm service ######"}; 15 | char r[100] = {" please enter your secret pin"}; 16 | char oy[100] = {"[1] check balance "}; 17 | char t[100] = {"[2] withdraw cash "}; 18 | char u[100] = {"[3] deposite cash "}; 19 | char v[100] = {"[4] quit "}; 20 | char w[100] = {"your balance is : "}; 21 | char x[100] = {"enter the amount you want to withdraw "}; 22 | char y[100] = {"[ press any key to continue ]"}; 23 | char z[100] = {"do you wish to have another transaction(y/n) ????"}; 24 | char h[100] = {"$$$$$$ thanks for using our atm service $$$$$$"}; 25 | char i[100] = {"invalid amount !!!! please enter the amount in multiples of [ 100 ]"}; 26 | char l[100] = {" your account has insufficient balance !!!"}; 27 | char m[100] = {"$$$ please collect your cash $$$$"}; 28 | char n[100] = {" your current balance is "}; 29 | char o[100] = {" enter the amount to deposite "}; 30 | char p[100] = {" your current balance is "}; 31 | char q[100] = {" Invalid Option !! Please try Again... "}; 32 | void main() 33 | { 34 | system("color F0"); 35 | system("cls"); 36 | while (1) 37 | { 38 | system("cls"); 39 | fg: 40 | printf("\n\n\n\n\n\n\n\n\n\t\t\t"); 41 | for (g = 0; g < strlen(f); g++) 42 | { 43 | system("color 3f"); 44 | printf("%c", f[g]); 45 | Sleep(30); 46 | if (f[g] >= 97 && f[g] <= 122) 47 | { 48 | f[g] = f[g] - 32; 49 | printf("\b%c", f[g]); 50 | Sleep(30); 51 | } 52 | } 53 | Sleep(2200); 54 | uber: 55 | system("cls"); 56 | printf("\n\n\n\n\n\n\n\n\n\t\t\t "); 57 | for (g = 0; g < strlen(r); g++) 58 | { 59 | system("color 3f"); 60 | printf("%c", r[g]); 61 | Sleep(30); 62 | if (r[g] >= 97 && r[g] <= 122) 63 | { 64 | r[g] = r[g] - 32; 65 | printf("\b%c", r[g]); 66 | Sleep(30); 67 | } 68 | } 69 | //system("cls"); 70 | printf("\n\n\n\t\t\t\t\t "); 71 | for (yt = 0; yt < 100; yt++) 72 | { 73 | ch = getch(); 74 | pass[yt] = ch; 75 | if (ch != 13) 76 | printf("*"); 77 | else 78 | break; 79 | } 80 | pass[yt] = '\0'; 81 | //system("cls"); 82 | if (strcmpi(pass, "9876") == 0) 83 | goto ola; 84 | else 85 | { 86 | int kk = 4; 87 | jhg: 88 | system("cls"); 89 | system("color 4f"); 90 | printf("\n\n\n\n\n\n\n\t\t XXXX Please Enter Valid PIN XXXX"); 91 | kk--; 92 | if (kk == 0) 93 | { 94 | Sleep(2000); 95 | system("cls"); 96 | system("color F0"); 97 | goto uber; 98 | } 99 | else 100 | { 101 | printf("\a\a"); 102 | Sleep(400); 103 | system("cls"); 104 | Sleep(400); 105 | goto jhg; 106 | } 107 | } 108 | 109 | ola: 110 | system("cls"); 111 | system("color 1f"); 112 | printf("\n\n\n\n\n\n\n\t"); 113 | for (g = 0; g < strlen(oy); g++) 114 | { 115 | // system("color 3f"); 116 | printf("%c", oy[g]); 117 | Sleep(30); 118 | if (oy[g] >= 97 && oy[g] <= 122) 119 | { 120 | oy[g] = oy[g] - 32; 121 | printf("\b%c", oy[g]); 122 | Sleep(30); 123 | } 124 | } 125 | printf("\t\t\t\t"); 126 | for (g = 0; g < strlen(t); g++) 127 | { 128 | //system("color 3f"); 129 | printf("%c", t[g]); 130 | Sleep(30); 131 | if (t[g] >= 97 && t[g] <= 122) 132 | { 133 | t[g] = t[g] - 32; 134 | printf("\b%c", t[g]); 135 | Sleep(30); 136 | } 137 | } 138 | printf("\n\n\n\n\n\n\t"); 139 | for (g = 0; g < strlen(u); g++) 140 | { 141 | //system("color 3f"); 142 | printf("%c", u[g]); 143 | Sleep(30); 144 | if (u[g] >= 97 && u[g] <= 122) 145 | { 146 | u[g] = u[g] - 32; 147 | printf("\b%c", u[g]); 148 | Sleep(30); 149 | } 150 | } 151 | printf("\t\t\t\t"); 152 | for (g = 0; g < strlen(v); g++) 153 | { 154 | //system("color 3f"); 155 | printf("%c", v[g]); 156 | Sleep(30); 157 | if (v[g] >= 97 && v[g] <= 122) 158 | { 159 | v[g] = v[g] - 32; 160 | printf("\b%c", v[g]); 161 | Sleep(30); 162 | } 163 | } 164 | //scanf("%d", &choice); 165 | ch = getch(); 166 | if (ch == '1') 167 | { 168 | system("cls"); 169 | goto x; 170 | } 171 | else if (ch == '2') 172 | { 173 | system("cls"); 174 | goto a; 175 | } 176 | else if (ch == '3') 177 | { 178 | system("cls"); 179 | goto b; 180 | } 181 | else if (ch == '4') 182 | { 183 | system("cls"); 184 | goto c; 185 | } 186 | else 187 | { 188 | system("cls"); 189 | goto y; 190 | } 191 | switch (choice) 192 | { 193 | x: 194 | case 1: 195 | system("color 5f"); 196 | printf("\n\n\n\n\n\n\n\t\t\t"); 197 | for (g = 0; g < strlen(w); g++) 198 | { 199 | //system("color 3f"); 200 | printf("%c", w[g]); 201 | Sleep(30); 202 | if (w[g] >= 97 && w[g] <= 122) 203 | { 204 | w[g] = w[g] - 32; 205 | printf("\b%c", w[g]); 206 | Sleep(30); 207 | } 208 | } 209 | printf("%0.2f Rs.", amount); 210 | Sleep(3000); 211 | system("cls"); 212 | //printf("\n\n Press Any key to continue....\n\n"); 213 | printf("\n\n\n\n\n\n\t\t\t"); 214 | for (g = 0; g < strlen(y); g++) 215 | { 216 | //system("color 3f"); 217 | printf("%c", y[g]); 218 | Sleep(30); 219 | if (y[g] >= 97 && y[g] <= 122) 220 | { 221 | y[g] = y[g] - 32; 222 | printf("\b%c", y[g]); 223 | Sleep(30); 224 | } 225 | } 226 | getch(); 227 | break; 228 | a: 229 | case 2: 230 | //printf("\n ENTER THE AMOUNT TO WITHDRAW: "); 231 | printf("\n\n\n\n\n\n\n\t\t\t"); 232 | for (g = 0; g < strlen(x); g++) 233 | { 234 | system("color 2f"); 235 | printf("%c", x[g]); 236 | Sleep(30); 237 | if (x[g] >= 97 && x[g] <= 122) 238 | { 239 | x[g] = x[g] - 32; 240 | printf("\b%c", x[g]); 241 | Sleep(30); 242 | } 243 | } 244 | printf("\n\n\n\n\t\t\t\t\t"); 245 | scanf("%d", &withdraw); 246 | system("cls"); 247 | if (withdraw > (amount - 500)) 248 | { 249 | printf("\a\a\a\a\a\a"); 250 | printf("\n\n\n\n\n\n\n\t\t"); 251 | 252 | for (g = 0; g < strlen(l); g++) 253 | { 254 | system("color 4f"); 255 | printf("%c", l[g]); 256 | Sleep(30); 257 | if (l[g] >= 97 && l[g] <= 122) 258 | { 259 | l[g] = l[g] - 32; 260 | // printf("\a"); 261 | printf("\b%c", l[g]); 262 | Sleep(30); 263 | } 264 | } 265 | Sleep(2000); 266 | } 267 | else if (withdraw % 100 != 0) 268 | { 269 | printf("\a\a\a\a\a\a"); 270 | printf("\n\n\n\n\n\n\n\t"); 271 | for (g = 0; g < strlen(i); g++) 272 | { 273 | system("color 4f"); 274 | printf("%c", i[g]); 275 | Sleep(30); 276 | if (i[g] >= 97 && i[g] <= 122) 277 | { 278 | i[g] = i[g] - 32; 279 | // printf("\a"); 280 | printf("\b%c", i[g]); 281 | Sleep(30); 282 | } 283 | } 284 | Sleep(3000); 285 | //satyam=amount-500; 286 | } 287 | else 288 | { 289 | amount = amount - withdraw; 290 | printf("\n\n\n\n\n\n\n\t\t\t"); 291 | for (g = 0; g < strlen(m); g++) 292 | { 293 | system("color 2f"); 294 | printf("%c", m[g]); 295 | Sleep(30); 296 | if (m[g] >= 97 && m[g] <= 122) 297 | { 298 | m[g] = m[g] - 32; 299 | printf("\b%c", m[g]); 300 | Sleep(30); 301 | } 302 | } 303 | Sleep(2000); 304 | system("cls"); 305 | printf("\n\n\n\n\n\n\t\t\t\t"); 306 | for (g = 0; g < strlen(n); g++) 307 | { 308 | system("color 2f"); 309 | printf("%c", n[g]); 310 | Sleep(30); 311 | if (n[g] >= 97 && n[g] <= 122) 312 | { 313 | n[g] = n[g] - 32; 314 | printf("\b%c", n[g]); 315 | Sleep(30); 316 | } 317 | } 318 | printf("%0.2f Rs.", amount); 319 | Sleep(2000); 320 | } 321 | break; 322 | b: 323 | case 3: 324 | printf("\n\n\n\n\n\n\n\t\t\t "); 325 | for (g = 0; g < strlen(o); g++) 326 | { 327 | system("color 3f"); 328 | printf("%c", o[g]); 329 | Sleep(30); 330 | if (o[g] >= 97 && o[g] <= 122) 331 | { 332 | o[g] = o[g] - 32; 333 | printf("\b%c", o[g]); 334 | Sleep(30); 335 | } 336 | } 337 | printf("\n\n\n\n\t\t\t\t\t"); 338 | scanf("%d", &deposit); 339 | amount = amount + deposit; 340 | system("cls"); 341 | printf("\n\n\n\n\n\n\n\t\t\t"); 342 | for (g = 0; g < strlen(p); g++) 343 | { 344 | system("color 3f"); 345 | printf("%c", p[g]); 346 | Sleep(30); 347 | if (p[g] >= 97 && p[g] <= 122) 348 | { 349 | p[g] = p[g] - 32; 350 | printf("\b%c", p[g]); 351 | Sleep(30); 352 | } 353 | } 354 | printf("%0.2f Rs.", amount); 355 | Sleep(3000); 356 | break; 357 | c: 358 | case 4: 359 | printf("\n\n\n\n\n\n\n\n\t\t\t"); 360 | for (g = 0; g < strlen(h); g++) 361 | { 362 | system("color 1f"); 363 | printf("%c", h[g]); 364 | Sleep(30); 365 | if (h[g] >= 97 && h[g] <= 122) 366 | { 367 | h[g] = h[g] - 32; 368 | printf("\b%c", h[g]); 369 | Sleep(30); 370 | } 371 | } 372 | exit(1); 373 | default: 374 | y: 375 | // printf("\n Invalid Option !! Please try Again..."); 376 | printf("\n\n\n\n\n\n\n\n\t\t\t"); 377 | printf("\a\a\a\a\a\a"); 378 | for (g = 0; g < strlen(q); g++) 379 | { 380 | system("color 4f"); 381 | printf("%c", q[g]); 382 | Sleep(30); 383 | if (q[g] >= 97 && q[g] <= 122) 384 | { 385 | q[g] = q[g] - 32; 386 | //printf("\a"); 387 | printf("\b%c", q[g]); 388 | Sleep(30); 389 | } 390 | } 391 | Sleep(3000); 392 | system("cls"); 393 | break; 394 | } 395 | system("cls"); 396 | //printf("\n\n\n DO U WISH TO HAVE ANOTHER TRANSCATION?(y/n): \n"); 397 | printf("\n\n\n\n\n\n\n\n\t\t\t"); 398 | for (g = 0; g < strlen(z); g++) 399 | { 400 | system("color 8f"); 401 | printf("%c", z[g]); 402 | Sleep(20); 403 | if (z[g] >= 97 && z[g] <= 122) 404 | { 405 | z[g] = z[g] - 32; 406 | printf("\b%c", z[g]); 407 | Sleep(20); 408 | } 409 | } 410 | fflush(stdin); 411 | ch = getch(); 412 | if (ch == 'n' || ch == 'N') 413 | return; 414 | } 415 | } 416 | -------------------------------------------------------------------------------- /Mini Projects/Bank/Bank_Management_System.c: -------------------------------------------------------------------------------- 1 | // Note: Try to run this Code on DEV-C++ IDE 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | void mainmenu(void); 11 | void add(void); 12 | void list(void); 13 | void closes(void); 14 | void Password(void); 15 | void edit(); 16 | void transactions(); 17 | char password[20] = {"psitkanpur"}; 18 | char find; 19 | struct date 20 | { 21 | int day, month, year; 22 | }; 23 | struct BANK 24 | { 25 | char fname[50]; 26 | char name[30]; 27 | char addr[60]; 28 | double cash; 29 | char adhno[20]; 30 | double mobno; 31 | double accno; 32 | struct date dob; 33 | struct date withdraw; 34 | struct date deposite; 35 | } bank, check, upd, dele, transaction; 36 | FILE *fp, *fps; 37 | int main() 38 | { 39 | SetConsoleTitle("@ SATYAM TRIPATHI and COMPANY ---------> BANK MANAGEMENT SYSTEM"); 40 | system("color 3f"); 41 | Password(); 42 | getch(); 43 | return 0; 44 | } 45 | void mainmenu() 46 | { 47 | system("cls"); 48 | int i; 49 | t(); 50 | system("color 5f"); 51 | printf("\n\t\t\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2 WELCOME TO TRIPATHI'S BANK \xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2"); 52 | printf("\n\n\t\t"); 53 | printf("\xDB\xDB\xDB\xDB\xB2 1. Create New Account "); 54 | printf("\n\n\t\t"); 55 | printf("\xDB\xDB\xDB\xDB\xB2 2. Close Your Account"); 56 | printf("\n\n\t\t"); 57 | printf("\xDB\xDB\xDB\xDB\xB2 3. Search Your Account Details"); 58 | printf("\n\n\t\t"); 59 | printf("\xDB\xDB\xDB\xDB\xB2 4. Modify Your Account Details"); 60 | printf("\n\n\t\t"); 61 | printf("\xDB\xDB\xDB\xDB\xB2 5. For Transaction"); 62 | printf("\n\n\t\t"); 63 | printf("\xDB\xDB\xDB\xDB\xB2 6. Close Application"); 64 | printf("\n\n\t\t"); 65 | printf("\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB"); 66 | printf(" \n\n\t\tPlease Enter your choice : "); 67 | switch (getch()) 68 | { 69 | case '1': 70 | add(); 71 | break; 72 | case '2': 73 | closes(); 74 | break; 75 | case '3': 76 | list(); 77 | break; 78 | case '4': 79 | edit(); 80 | break; 81 | case '5': 82 | transactions(); 83 | break; 84 | case '6': 85 | { 86 | system("cls"); 87 | printf("\n\n\n\n\n\t\t"); 88 | printf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2 THANKS!! TO BE A PART OF OUR LIBRARY \xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2"); 89 | Sleep(3000); 90 | exit(0); 91 | } 92 | break; 93 | default: 94 | { 95 | printf("\n\n\t\t"); 96 | printf("\a\a Wrong Choice !!! Plesae Choose the correct OPTION"); 97 | Sleep(2000); 98 | mainmenu(); 99 | } 100 | } 101 | } 102 | int t(void) 103 | { 104 | time_t t; 105 | time(&t); 106 | printf("\n\t\tDATE and TIME : %s", ctime(&t)); 107 | return 0; 108 | } 109 | void add() 110 | { 111 | int g; 112 | char ch; 113 | char choice; 114 | struct BANK b; 115 | fp = fopen("coursera.dat", "ab+"); 116 | system("cls"); 117 | system("color 2f"); 118 | printf("\n\n\t\t\xDB\xDB\xDB\xDB\xB2 Enter today's DATE(DD/MM/YYYY) : "); 119 | scanf("%d/%d/%d", &bank.deposite.day, &bank.deposite.month, &bank.deposite.year); 120 | printf("\n\n\t\t\xDB\xDB\xDB\xDB\xB2 Choose YOUR ACCOUNT NO. : "); 121 | scanf("%lf", &check.accno); 122 | while (fread(&bank, sizeof(bank), 1, fp) == 1) 123 | { 124 | if (bank.accno == check.accno) 125 | { 126 | system("cls"); 127 | system("color 4f"); 128 | printf("\n\n\n\n\n\t\t\t WARNING !! THE RECORD ALREADY EXISTS.\n"); 129 | getch(); 130 | mainmenu(); 131 | } 132 | } 133 | bank.accno = check.accno; 134 | system("color 3f"); 135 | fflush(stdin); 136 | printf("\n\n\t\t\xDB\xDB\xDB\xDB\xB2 \"First Name\" of the Person : "); 137 | gets(bank.fname); 138 | fflush(stdin); 139 | printf("\n\n\t\t\xDB\xDB\xDB\xDB\xB2 \"LAST Name\" of the Person : "); 140 | gets(bank.name); 141 | fflush(stdin); 142 | printf("\n\n\t\t\xDB\xDB\xDB\xDB\xB2 \"ADDRESS\" of the Person : "); 143 | gets(bank.addr); 144 | fflush(stdin); 145 | printf("\n\n\t\t\xDB\xDB\xDB\xDB\xB2 Enter the \"Phone No.\" : "); 146 | scanf("%lf", &bank.mobno); 147 | fflush(stdin); 148 | printf("\n\n\t\t\xDB\xDB\xDB\xDB\xB2 Enter The \"AADHAR NO.\": "); 149 | gets(bank.adhno); 150 | printf("\n\n\t\t\xDB\xDB\xDB\xDB\xB2 Please Deposite minimum cash [500] : "); 151 | scanf("%lf", &bank.cash); 152 | fseek(fp, 0, SEEK_END); 153 | fwrite(&bank, sizeof(bank), 1, fp); 154 | fclose(fp); 155 | system("cls"); 156 | printf("\n\n\n\n\n\n\t\t\t\t RECORD SAVING"); 157 | for (g = 0; g < 5; g++) 158 | { 159 | Sleep(300); 160 | printf("."); 161 | } 162 | system("cls"); 163 | printf("\n\n\n\n\n\n\t\t\t\t RECORD SAVING"); 164 | for (g = 0; g < 5; g++) 165 | { 166 | Sleep(300); 167 | printf("."); 168 | } 169 | system("cls"); 170 | printf("\n\n\n\n\n\n\t\t\t\t RECORD SAVING"); 171 | for (g = 0; g < 5; g++) 172 | { 173 | Sleep(300); 174 | printf("."); 175 | } 176 | system("cls"); 177 | printf("\n\n\n\n\n\t\t\t !! Account Created Successfully !!\n\n"); 178 | printf("\n\n\n\n\t\t Do you Want Create More Acccounts...Press(Y/N)\t\n\n"); 179 | choice = getch(); 180 | if (choice == 'n' || choice == 'N') 181 | mainmenu(); 182 | else 183 | { 184 | system("cls"); 185 | add(); 186 | } 187 | } 188 | void list() 189 | { 190 | int g; 191 | char choice; 192 | int d = 0; 193 | system("color 1E"); 194 | system("cls"); 195 | fflush(stdin); 196 | printf("\n\n\t\t\xDB\xDB\xDB\xDB\xB2 ENTER PHONE NO. : "); 197 | scanf("%lf", &check.mobno); 198 | system("cls"); 199 | printf("\n\n\n\t\t\t\tSearching"); 200 | for (g = 0; g < 3; g++) 201 | { 202 | printf("."); 203 | Sleep(500); 204 | } 205 | system("cls"); 206 | printf("\n\n\n\t\t\t\tSearching"); 207 | for (g = 0; g < 3; g++) 208 | { 209 | printf("."); 210 | Sleep(500); 211 | } 212 | system("cls"); 213 | printf("\n\n\n\t\t\t\tSearching"); 214 | for (g = 0; g < 3; g++) 215 | { 216 | printf("."); 217 | Sleep(500); 218 | } 219 | system("cls"); 220 | fps = fopen("coursera.dat", "rb+"); 221 | rewind(fps); 222 | while (fread(&bank, sizeof(bank), 1, fps) == 1) 223 | { 224 | if (bank.mobno == check.mobno) 225 | { 226 | system("cls"); 227 | system("color 2B"); 228 | printf("\n\n\n\t\t\t\t RECORDS Are Given As Follows : "); 229 | printf("\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 ACCOUNT CREATED ON : %d/%d/%d", bank.deposite.day, bank.deposite.month, bank.deposite.year); 230 | printf("\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 PHONE NO. : %0.0lf", bank.mobno); 231 | printf("\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 FIRST NAME : %s", bank.fname); 232 | printf("\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 LAST NAME : %s", bank.name); 233 | printf("\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 ADDRESS : %s", bank.addr); 234 | printf("\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 AADHAR NO. : %s", bank.adhno); 235 | printf("\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 AVAILABLE BALANCE : %0.0lf Rs.", bank.cash); 236 | printf("\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 ACCOUNT NO. : %0.0lf", bank.accno); 237 | d++; 238 | } 239 | } 240 | if (d == 0) 241 | { 242 | printf("\n\n\n\n\n\t\t\t\tNo Record Found"); 243 | Sleep(2000); 244 | } 245 | printf("\n\n\n\n\t\t\tWOULD YOU LIKE TO VIEW MORE RECORDS (Y/N)"); 246 | choice = getch(); 247 | if (choice == 'y' || choice == 'Y') 248 | list(); 249 | else 250 | { 251 | system("cls"); 252 | mainmenu(); 253 | } 254 | } 255 | void closes(void) 256 | { 257 | system("cls"); 258 | int a = 0, g; 259 | FILE *temps, *sat; 260 | system("color 3f"); 261 | printf("\n\n\n\n\n Enter the \"PHONE NO.\" of the Person those Account you want to CLOSE :\n\n\t\t\t\t"); 262 | scanf("%lf", &dele.mobno); 263 | for (g = 0; g < 3; g++) 264 | { 265 | printf("."); 266 | Sleep(500); 267 | } 268 | system("cls"); 269 | printf("\n\n\n\t\t\t\tProcessing"); 270 | for (g = 0; g < 3; g++) 271 | { 272 | printf("."); 273 | Sleep(500); 274 | } 275 | system("cls"); 276 | printf("\n\n\n\t\t\t\tProcessing"); 277 | for (g = 0; g < 3; g++) 278 | { 279 | printf("."); 280 | Sleep(500); 281 | } 282 | system("cls"); 283 | 284 | printf("\n\n\n\t\t\t\tProcessing"); 285 | for (g = 0; g < 3; g++) 286 | { 287 | printf("."); 288 | Sleep(500); 289 | } 290 | system("cls"); 291 | sat = fopen("coursera.dat", "r"); 292 | temps = fopen("newchannel.dat", "w"); 293 | rewind(sat); 294 | while (fread(&bank, sizeof(bank), 1, sat) == 1) 295 | { 296 | if (bank.mobno != dele.mobno) 297 | { 298 | fwrite(&bank, sizeof(bank), 1, temps); 299 | } 300 | else 301 | { 302 | a++; 303 | system("cls"); 304 | printf("\n\n\n\n\t\t !!!! Account closes Successfully !!!!\n"); 305 | Sleep(2000); 306 | } 307 | } 308 | fclose(sat); 309 | fclose(temps); 310 | remove("coursera.dat"); 311 | rename("newchannel.dat", "udemyss.dat"); 312 | if (a == 0) 313 | { 314 | system("cls"); 315 | printf("\n\n\n\n\n\t\t\tBank Can't Reach To The Moment"); 316 | printf("\n\n\n\n\t\t\tPress Any Key To Go Back !!"); 317 | getch(); 318 | mainmenu(); 319 | } 320 | else 321 | { 322 | system("cls"); 323 | printf("\n\tDO YOU LIKE TO DELETE ANOTHER RECORD.(Y/N):"); 324 | if (getch() == 'y') 325 | closes(); 326 | else 327 | mainmenu(); 328 | } 329 | } 330 | void Password(void) 331 | { 332 | system("cls"); 333 | char ch, pass[10]; 334 | int i = 0, j, g; 335 | system("color 1f"); 336 | printf("\n\n\n\n\n\t\t\t !!!! PASSWORD PROTECTED SYSTEM !!!!"); 337 | printf("\n\n\n\n\t\t\t PLEASE ENTER THE SECURITY CODE :"); 338 | printf("\n\n\t\t\t\t\t"); 339 | pass[i] = getch(); 340 | while (pass[i] != '\r') 341 | { 342 | if (pass[i] == '\b') 343 | { 344 | i--; 345 | printf("\b"); 346 | printf(" "); 347 | printf("\b"); 348 | pass[i] = getch(); 349 | } 350 | else 351 | { 352 | printf("*"); 353 | i++; 354 | pass[i] = getch(); 355 | } 356 | } 357 | pass[i] = '\0'; 358 | if (strcmpi(pass, password) == 0) 359 | { 360 | 361 | system("cls"); 362 | printf("\n\n\n\n\n\n\t\t\t\t Matching"); 363 | for (g = 0; g < 4; g++) 364 | { 365 | Sleep(500); 366 | printf("."); 367 | } 368 | system("cls"); 369 | printf("\n\n\n\n\n\n\t\t\t\t Matching"); 370 | for (g = 0; g < 4; g++) 371 | { 372 | Sleep(500); 373 | printf("."); 374 | } 375 | system("cls"); 376 | printf("\n\n\n\n\n\n\t\t\t\t Matching"); 377 | for (g = 0; g < 4; g++) 378 | { 379 | Sleep(500); 380 | printf("."); 381 | } 382 | system("cls"); 383 | printf("\n\n\n\n\n\t\t\t WELCOME !!!! SECURITY CODE MATCH"); 384 | Sleep(2000); 385 | mainmenu(); 386 | } 387 | else 388 | { 389 | system("cls"); 390 | printf("\n\n\n\n\n\n\t\t\t\t Matching"); 391 | for (g = 0; g < 4; g++) 392 | { 393 | Sleep(500); 394 | printf("."); 395 | } 396 | system("cls"); 397 | printf("\n\n\n\n\n\n\t\t\t\t Matching"); 398 | for (g = 0; g < 4; g++) 399 | { 400 | Sleep(500); 401 | printf("."); 402 | } 403 | 404 | system("cls"); 405 | printf("\n\n\n\n\n\n\t\t\t\t Matching"); 406 | for (g = 0; g < 4; g++) 407 | { 408 | Sleep(500); 409 | printf("."); 410 | } 411 | system("color 4f"); 412 | system("cls"); 413 | printf("\n\n\n\n\n\n\n\n\t\t\t WARNING !! Incorrect Security Code ??"); 414 | getch(); 415 | Password(); 416 | } 417 | } 418 | void edit(void) 419 | { 420 | char choice; 421 | system("cls"); 422 | int c = 0; 423 | int g; 424 | system("color 6f"); 425 | system("color 3F"); 426 | printf("\n\n\t\t\t Enter PHONE NO. of the Account Holder : \n\n\t\t\t\t\t"); 427 | scanf("%lf", &upd.mobno); 428 | fp = fopen("coursera.dat", "rb+"); 429 | while (fread(&bank, sizeof(bank), 1, fp) == 1) 430 | { 431 | if (bank.mobno == upd.mobno) 432 | { 433 | system("cls"); 434 | printf("\n\n\t\t\t\tThe Account is AVAILABLE"); 435 | printf("\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 ACCOUNT CREATED ON : %d/%d/%d", bank.deposite.day, bank.deposite.month, bank.deposite.year); 436 | printf("\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 ACCOUNT NO. is : %0.0lf", bank.accno); 437 | fflush(stdin); 438 | printf("\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 Enter New First Name : "); 439 | gets(bank.fname); 440 | printf("\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 Enter New Last Name : "); 441 | gets(bank.name); 442 | fflush(stdin); 443 | printf("\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 Enter New PHONE NO. : "); 444 | scanf("%lf", &bank.mobno); 445 | fflush(stdin); 446 | printf("\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 Enter New AADHAR No. : "); 447 | gets(bank.adhno); 448 | fflush(stdin); 449 | printf("\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 Enter New ADDRESS : "); 450 | gets(bank.addr); 451 | c++; 452 | system("cls"); 453 | printf("\n\n\n\n\n\t\t\t\t Record is Modifying"); 454 | for (g = 0; g < 4; g++) 455 | { 456 | Sleep(300); 457 | printf("."); 458 | } 459 | system("cls"); 460 | printf("\n\n\n\n\n\t\t\t\t Record is Modifying"); 461 | for (g = 0; g < 4; g++) 462 | { 463 | Sleep(300); 464 | printf("."); 465 | } 466 | system("cls"); 467 | printf("\n\n\n\n\n\t\t\t\t Record is Modifying"); 468 | for (g = 0; g < 4; g++) 469 | { 470 | Sleep(300); 471 | printf("."); 472 | } 473 | system("cls"); 474 | printf("\n\n\n\n\n\t\t\t\tThe Record is Modified"); 475 | Sleep(2000); 476 | fseek(fp, ftell(fp) - sizeof(bank), 0); 477 | fwrite(&bank, sizeof(bank), 1, fp); 478 | fclose(fp); 479 | } 480 | } 481 | if (c == 0) 482 | { 483 | system("cls"); 484 | printf("\n\n\n\n\t\t\t\t WARNING !! No Record Found "); 485 | Sleep(2000); 486 | } 487 | system("cls"); 488 | printf("\n\n\n\n\t\t\t Do You Want To Modify another Record(Y/N)"); 489 | choice = getch(); 490 | if (choice == 'Y' || choice == 'y') 491 | edit(); 492 | else 493 | mainmenu(); 494 | } 495 | void transactions(void) 496 | { 497 | char cho; 498 | system("cls"); 499 | int choice, test = 0; 500 | FILE *old, *temper; 501 | old = fopen("coursera.dat", "r"); 502 | temper = fopen("guvi.dat", "w"); 503 | printf("\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 Enter the Account No. of the Customer:"); 504 | scanf("%lf", &transaction.accno); 505 | while (fread(&bank, sizeof(bank), 1, old) == 1) 506 | { 507 | if (bank.accno == transaction.accno) 508 | { 509 | test = 1; 510 | system("cls"); 511 | printf("\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 1.DEPOSITE\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 2.WITHDRAW\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 Enter Your Choice : "); 512 | switch (getch()) 513 | { 514 | case '1': 515 | system("cls"); 516 | printf("\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 Enter the Amount you want to Deposit : "); 517 | scanf("%lf", &transaction.cash); 518 | bank.cash = bank.cash + transaction.cash; 519 | fseek(old, ftell(old) - sizeof(bank), 0); 520 | fwrite(&bank, sizeof(bank), 1, temper); 521 | system("cls"); 522 | printf("\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 Deposition Successful \xDB\xDB\xDB\xDB\xB2"); 523 | Sleep(2000); 524 | goto marr; 525 | case '2': 526 | system("cls"); 527 | printf("\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 Enter the Amount You Want to Withdraw : "); 528 | scanf("%lf", &transaction.cash); 529 | bank.cash = bank.cash - transaction.cash; 530 | fseek(old, ftell(old) - sizeof(bank), 0); 531 | fwrite(&bank, sizeof(bank), 1, temper); 532 | system("cls"); 533 | printf("\n\n\n\t\t\xDB\xDB\xDB\xDB\xB2 Withdraw Successful \xDB\xDB\xDB\xDB\xB2"); 534 | Sleep(2000); 535 | goto mar; 536 | } 537 | } 538 | else 539 | fwrite(&bank, sizeof(bank), 1, temper); 540 | } 541 | mar: 542 | marr: 543 | fclose(old); 544 | fclose(temper); 545 | remove("coursera.dat"); 546 | rename("guvi.dat", "coursera.dat"); 547 | system("cls"); 548 | printf("\n\n\n\t\t\t Would You like Make more Transactions[y/n]"); 549 | cho = getch(); 550 | if (cho == 'Y' || cho == 'y') 551 | transactions(); 552 | else 553 | mainmenu(); 554 | if (test != 1) 555 | { 556 | system("cls"); 557 | printf("\n\n\n\n\n\t\t\t !! Record not found !!"); 558 | printf("\n\n\n\t\t\t Press Any Key to go MAIN MENU !!"); 559 | getch(); 560 | mainmenu(); 561 | } 562 | } 563 | -------------------------------------------------------------------------------- /Mini Projects/Calendar/Calendar.c: -------------------------------------------------------------------------------- 1 | // Note: Try to run this code on DEV-C++ IDE 2 | 3 | #include 4 | #include 5 | #include 6 | int last_day[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; 7 | char *months[] = {" ", "\n\n\n\t\tJanuary", "\n\n\n\t\tFebruary", "\n\n\n\t\tMarch", "\n\n\n\t\tApril", "\n\n\n\t\tMay", "\n\n\n\t\tJune", "\n\n\n\t\tJuly", "\n\n\n\t\tAugust", "\n\n\n\t\tSeptember", "\n\n\n\t\tOctober", "\n\n\n\t\tNovember", "\n\n\n\t\tDecember"}; 8 | int findoutdaycode(int year) //this function will return the daycode 9 | { 10 | int codeofday; 11 | int d1, d2, d3; 12 | d1 = (year - 1) / 4; 13 | d2 = (year - 1) / 100; 14 | d3 = (year - 1) / 400; 15 | codeofday = (year + d1 - d2 + d3) % 7; 16 | return codeofday; 17 | } 18 | int leapyear(int year) 19 | { 20 | if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) 21 | { 22 | last_day[2] = 29; //if the given year will be LEAP then february becomes of 29th.. 23 | return 1; 24 | } 25 | else 26 | { 27 | last_day[2] = 28; //if the given year will not be LEAP then february becomes of 28th.. 28 | return 0; 29 | } 30 | } 31 | 32 | void calendar_printing(int year, int codeofday) 33 | { 34 | int month, day, i; 35 | printf("\n\n\t\t\t\t%d CALENDAR", year); 36 | printf("\n\n"); 37 | for (i = 0; i < 80; i++) 38 | { 39 | printf("\xdb"); 40 | } 41 | for (month = 1; month <= 12; month++) 42 | { 43 | printf("%s", months[month]); 44 | printf("\n\n Sun Mon Tue Wed Thu Fri Sat\n"); 45 | for (day = 1; day <= 1 + codeofday * 5; day++) //this function will set the position of date 1st. 46 | { 47 | printf(" "); 48 | } 49 | for (day = 1; day <= last_day[month]; day++) //printing all the dates of month. 50 | { 51 | Sleep(10); 52 | system("color f1"); 53 | printf("%2d", day); 54 | if ((day + codeofday) % 7 > 0) //here we check thast the day is before saturday or not.. 55 | printf(" "); 56 | else 57 | { 58 | printf("\n "); 59 | } 60 | } 61 | codeofday = (codeofday + last_day[month]) % 7; //Now here we will move to the second month... 62 | 63 | printf("\n"); 64 | for (i = 0; i < 40; i++) 65 | { 66 | printf("\xdb"); 67 | } 68 | printf("\n\n"); 69 | } 70 | } 71 | 72 | int main() < % // We can also use this symbol in place of {}.. 73 | // this SetConsoleTitle is used to set any name in the output window... 74 | int row, 75 | col, r, c, q; 76 | SetConsoleTitle("SATYAM TRIPATHI'S PROGRAM---->>> BEST CALENDAR USING C PROGRAMMING"); 77 | system("color 1f"); 78 | int year, codeofday; 79 | int i, j, k; 80 | system("color 1E"); 81 | for (i = 0; i < 80; i++) 82 | { 83 | printf("\xdb"); 84 | } 85 | printf("\n"); 86 | for (i = 0; i < 80; i++) 87 | { 88 | printf("\xdb"); 89 | } 90 | printf("\n"); 91 | for (i = 0; i < 80; i++) 92 | { 93 | printf("\xdb"); 94 | } 95 | printf("\t\t\t\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5"); 96 | printf("\n\t\t\t\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5"); 97 | printf("\n\t\t\t\5\5\5\5\5\5 \5\5\5\5\5\5"); 98 | printf("\n\t\t\t\5\5\5\5\5\5 \5\5\5\5\5\5"); 99 | printf("\n\t\t\t\5\5\5\5\5\5 \5\5\5\5\5\5"); 100 | printf("\n\t\t\t\5\5\5\5\5\5 CALENDAR \5\5\5\5\5\5"); 101 | printf("\n\t\t\t\5\5\5\5\5\5 \5\5\5\5\5\5"); 102 | printf("\n\t\t\t\5\5\5\5\5\5 \5\5\5\5\5\5"); 103 | printf("\n\t\t\t\5\5\5\5\5\5 \5\5\5\5\5\5"); 104 | printf("\n\t\t\t\5\5\5\5\5\5 \5\5\5\5\5\5"); 105 | printf("\n\t\t\t\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5"); 106 | printf("\n\t\t\t\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5\5"); 107 | printf("\n"); 108 | for (i = 0; i < 80; i++) 109 | { 110 | printf("\xdb"); 111 | } 112 | printf("\n"); 113 | for (i = 0; i < 80; i++) 114 | { 115 | printf("\xdb"); 116 | } 117 | printf("\n"); 118 | for (i = 0; i < 80; i++) 119 | { 120 | printf("\xdb"); 121 | } 122 | printf("\n"); 123 | Sleep(3000); 124 | system("cls"); 125 | printf("\n\n\n\n\t\t\t\tEnter the Year :"); 126 | printf("\n\n\t\t\t\t "); 127 | scanf("%d", &year); 128 | system("color 1e"); 129 | printf("\n\n\n\t\t\t\t LOADING"); 130 | printf("\n\n\t\t\t "); 131 | for (r = 2; r <= 20; r++) 132 | { 133 | for (q = 1; q <= 100000000; q++) 134 | ; 135 | printf("%c", 186); 136 | } 137 | Sleep(1000); 138 | system("cls"); 139 | codeofday = findoutdaycode(year); //Here we will find the code of the day by calling function findouttheday !! 140 | leapyear(year); 141 | calendar_printing(year, codeofday); 142 | printf("\n"); 143 | % > 144 | -------------------------------------------------------------------------------- /Mini Projects/Digital Clock/Digital_Clock.c: -------------------------------------------------------------------------------- 1 | // Note: Try to run this Code on DEV-C++ 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | int main() 9 | { 10 | time_t t = time(NULL); 11 | struct tm tm = *localtime(&t); 12 | system("color 1f"); 13 | int hour, minute, second; 14 | hour = minute = second = 0; 15 | hour = tm.tm_hour; 16 | minute = tm.tm_min; 17 | second = tm.tm_sec; 18 | while (1) 19 | { 20 | system("cls"); 21 | printf("\n\n\n\n\n\t\t\t\tCurrent Time is :"); 22 | printf("\n\n\n\t\t\t\t %02d : %02d : %02d ", hour, minute, second); 23 | second++; 24 | if (second == 60) 25 | { 26 | minute = minute + 1; 27 | second = 0; 28 | } 29 | if (minute == 60) 30 | { 31 | hour = hour + 1; 32 | minute = 0; 33 | } 34 | if (hour == 24) 35 | { 36 | hour = 0; 37 | minute = 0; 38 | second = 0; 39 | } 40 | 41 | Sleep(1000); 42 | } 43 | 44 | return 0; 45 | } 46 | -------------------------------------------------------------------------------- /Mini Projects/KBC Quiz bot/KBC_Quiz_Bot.c: -------------------------------------------------------------------------------- 1 | // Note: Try to run this Code on DEV-C++ 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | int main() 10 | { 11 | char oy[100] = {"[[[ Correct answers are ]]]"}; 12 | char ds[100] = {"[[[ Wrong answers are ]]]"}; 13 | int i, a[10], n = 0, sat = 0, t = 0, g, z[10], y[10]; 14 | char ch; 15 | system("color 1f"); 16 | system("kbc2.mp3"); 17 | printf("\n\n\n\n\n\t\t\tWELCOME TO \"KAUN BANEGA CROREPATI\""); 18 | Sleep(2000); 19 | system("cls"); 20 | for (i = 1; i <= 10; i++) 21 | { 22 | n = 0; 23 | switch (i) 24 | { 25 | system("cls"); 26 | 27 | case 1: 28 | printf("\n\n\n\n\n\t\t\t [[[ Float is the ]]]"); 29 | printf("\n\n\n\n\t\t[1]. Data type\t\t\t[3]. Label\n\n\n\t\t[2]. Process\t\t\t[4]. Variable"); 30 | //scanf("%d",&n); 31 | ch = getch(); 32 | if (ch == '1') 33 | { 34 | sat++; 35 | system("cls"); 36 | goto x; 37 | } 38 | else 39 | { 40 | t++; 41 | goto tu; 42 | } 43 | break; 44 | tu: 45 | x: 46 | case 2: 47 | system("cls"); 48 | printf("\n\n\n\n\n\t\t[[[ In a flowchart , a parallelogram indicates ]]]"); 49 | printf("\n\n\n\n\t\t[1]. Process\t\t\t[3]. Input/Output\n\n\n\t\t[2]. Decision\t\t\t[4]. start/End"); 50 | //scanf("%d",&n); 51 | ch = getch(); 52 | if (ch == '3') 53 | { 54 | sat++; 55 | system("cls"); 56 | goto b; 57 | } 58 | else 59 | { 60 | t++; 61 | goto tr; 62 | } 63 | break; 64 | b: 65 | tr: 66 | case 3: 67 | system("cls"); 68 | printf("\n\n\n\n\n\t[[[ Which of the following is not a basic data type in C language ]]]"); 69 | printf("\n\n\n\n\t\t[1]. Float\t\t\t[3]. int\n\n\n\t\t[2]. real\t\t\t[4]. char"); 70 | //scanf("%d",&n); 71 | ch = getch(); 72 | if (ch == '2') 73 | { 74 | sat++; 75 | system("cls"); 76 | goto c; 77 | } 78 | else 79 | { 80 | t++; 81 | goto tri; 82 | } 83 | break; 84 | tri: 85 | c: 86 | case 4: 87 | system("cls"); 88 | printf("\n\n\n\n\n [[[ The program written by the programmer in high level language is called ]]]"); 89 | printf("\n\n\n\n\t[1]. Object program \t\t\t[3]. Source program\n\n\n\t[2]. Assembled program\t\t\t[4]. compiled program"); 90 | //scanf("%d",&n); 91 | ch = getch(); 92 | if (ch == '3') 93 | { 94 | sat++; 95 | system("cls"); 96 | goto d; 97 | } 98 | else 99 | { 100 | t++; 101 | goto tg; 102 | } 103 | break; 104 | tg: 105 | d: 106 | case 5: 107 | system("cls"); 108 | printf("\n\n\n\n\n\t\t[[[ By default a real number is treated as a ]]]"); 109 | printf("\n\n\n\n\t\t[1]. Float\t\t\t[3]. Double\n\n\n\t\t[2]. Long Double\t\t[4]. Far Double"); 110 | //scanf("%d",&n); 111 | ch = getch(); 112 | if (ch == '1') 113 | { 114 | sat++; 115 | system("cls"); 116 | goto e; 117 | } 118 | else 119 | { 120 | t++; 121 | goto tf; 122 | } 123 | break; 124 | tf: 125 | e: 126 | case 6: 127 | system("cls"); 128 | printf("\n\n\n\n\n [[[ which of the folloeing special symbol allowed in a variable name ]]]"); 129 | printf("\n\n\n\n\t\t[1]. aestrisk(*)\t\t[3]. pipeline(|)\n\n\n\t\t[2]. hyphen(-)\t\t\t[4]. undescore(_)"); 130 | //scanf("%d",&n); 131 | ch = getch(); 132 | if (ch == '1') 133 | { 134 | sat++; 135 | system("cls"); 136 | goto f; 137 | } 138 | else 139 | { 140 | t++; 141 | goto ts; 142 | } 143 | break; 144 | ts: 145 | f: 146 | case 7: 147 | system("cls"); 148 | printf("\n\n\n\n\n\t\t\t [[[ the value of EOF symbolic constant ]]]"); 149 | printf("\n\n\n\n\t[1]. -1 ,but vary according to the compiler\t\t[3]. 1\n\n\n\t[2]. -1\t\t\t\t\t\t\t[4]. Error"); 150 | //scanf("%d",&n); 151 | ch = getch(); 152 | if (ch == '1') 153 | { 154 | sat++; 155 | system("cls"); 156 | goto g; 157 | } 158 | else 159 | { 160 | t++; 161 | goto td; 162 | } 163 | break; 164 | td: 165 | g: 166 | case 8: 167 | system("cls"); 168 | printf("\n\n\n\n\n\t\t[[[ In which order do the following gets evaluated ]]]"); 169 | printf("\n\n\n\t\tRelational , Arithmetic , Logical , Assignment"); 170 | printf("\n\n\n\n\t\t\t[1]. 4,3,2,1\t\t[3]. 2,1,3,4\n\n\n\t\t\t[2]. 1,2,3,4\t\t[4]. 3,2,1,4"); 171 | //scanf("%d",&n); 172 | ch = getch(); 173 | if (ch == '3') 174 | { 175 | sat++; 176 | system("cls"); 177 | goto h; 178 | } 179 | else 180 | { 181 | t++; 182 | goto tt; 183 | } 184 | break; 185 | tt: 186 | h: 187 | case 9: 188 | system("cls"); 189 | printf("\n\n\n\n\n\t\t[[[ how to scan one-by-one character of \"string\" at a time ]]]"); 190 | printf("\n\n\n\n\t\t\t[1]. getche()\t\t[3]. getchar()\n\n\n\t\t\t[2]. scanf()\t\t[4]. gets()"); 191 | //scanf("%d",&n); 192 | ch = getch(); 193 | if (ch == '3') 194 | { 195 | sat++; 196 | system("cls"); 197 | goto lo; 198 | } 199 | else 200 | { 201 | t++; 202 | goto ty; 203 | } 204 | break; 205 | ty: 206 | lo: 207 | case 10: 208 | system("cls"); 209 | printf("\n\n\n\n\n\tPrototype and related information related to \"graphics\" held in ]]]"); 210 | printf("\n\n\n\n\t\t[1]. graphics.h\t\t\t[3]. unistd.h\n\n\n\t\t[2]. windows.h\t\t\t[4]. stdio.h"); 211 | //scanf("%d",&n); 212 | ch = getch(); 213 | if (ch == '1') 214 | { 215 | sat++; 216 | i = 11; 217 | system("cls"); 218 | } 219 | else 220 | { 221 | t++; 222 | i = 11; 223 | } 224 | break; 225 | default: 226 | break; 227 | } 228 | } 229 | if (sat > t) 230 | { 231 | system("cls"); 232 | system("color 2f"); 233 | printf("\n\n\n\n\t\t\t"); 234 | for (g = 0; g < strlen(oy); g++) 235 | { 236 | printf("%c", oy[g]); 237 | Sleep(30); 238 | if (oy[g] >= 97 && oy[g] <= 122) 239 | { 240 | oy[g] = oy[g] - 32; 241 | printf("\b%c", oy[g]); 242 | Sleep(30); 243 | } 244 | } 245 | printf("\n\n\t\t\t\t %d", sat); 246 | printf("\n\n\n\n\t\t\t"); 247 | for (g = 0; g < strlen(ds); g++) 248 | { 249 | printf("%c", ds[g]); 250 | Sleep(30); 251 | if (ds[g] >= 97 && ds[g] <= 122) 252 | { 253 | ds[g] = ds[g] - 32; 254 | printf("\b%c", ds[g]); 255 | Sleep(30); 256 | } 257 | } 258 | system("color 2f"); 259 | printf("\n\n\t\t\t\t %d", t); 260 | } 261 | else 262 | { 263 | system("cls"); 264 | system("color 4f"); 265 | printf("\n\n\n\n\t\t\t"); 266 | for (g = 0; g < strlen(oy); g++) 267 | { 268 | printf("%c", oy[g]); 269 | Sleep(30); 270 | if (oy[g] >= 97 && oy[g] <= 122) 271 | { 272 | oy[g] = oy[g] - 32; 273 | printf("\b%c", oy[g]); 274 | Sleep(30); 275 | } 276 | } 277 | printf("\n\n\t\t\t\t %d", sat); 278 | printf("\a\a\a"); 279 | system("color 4f"); 280 | printf("\n\n\n\n\t\t\t"); 281 | for (g = 0; g < strlen(ds); g++) 282 | { 283 | printf("%c", ds[g]); 284 | Sleep(30); 285 | if (ds[g] >= 97 && ds[g] <= 122) 286 | { 287 | ds[g] = ds[g] - 32; 288 | printf("\b%c", ds[g]); 289 | Sleep(30); 290 | } 291 | } 292 | printf("\n\n\t\t\t\t %d", t); 293 | } 294 | } 295 | -------------------------------------------------------------------------------- /Mini Projects/Library Management System/Library_Management_System.c: -------------------------------------------------------------------------------- 1 | // Note: Try to run this Code on DEV-C++ 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #define RETURNTIME 15 12 | char catagories[][25] = {"Computer", "Electronics", "Electrical", "Civil", "Mechnnical", "Architecture", "Pharmacy", "Business", "Gate"}; 13 | void returnfunc(void); 14 | void mainmenu(void); 15 | void addbooks(void); 16 | void deletebooks(void); 17 | void editbooks(void); 18 | void searchbooks(void); 19 | void issuebooks(void); 20 | void viewbooks(void); 21 | void closeapplication(void); 22 | int getdata(); 23 | int checkid(int); 24 | int t(void); 25 | void Password(); 26 | void issuerecord(); 27 | FILE *fp, *ft, *fs; 28 | int s; 29 | char findbook; 30 | char password[20] = {"psitkanpur"}; 31 | struct meroDate 32 | { 33 | int mm, dd, yy; 34 | }; 35 | struct books 36 | { 37 | int id; 38 | char stname[20]; 39 | char name[20]; 40 | char Author[20]; 41 | int quantity; 42 | float Price; 43 | int count; 44 | int rackno; 45 | char *cat; 46 | struct meroDate issued; 47 | struct meroDate duedate; 48 | }; 49 | struct books a; 50 | int main() 51 | { 52 | SetConsoleTitle("@SATYAM TRIPATHI AND COMPANY -------->>> LIBRARY MANAGEMENT SYSTEM"); 53 | Password(); 54 | getch(); 55 | return 0; 56 | } 57 | void mainmenu() 58 | { 59 | system("cls"); 60 | int i; 61 | t(); 62 | printf("\n\t\t\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2 MAIN MENU \xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2"); 63 | printf("\n\n\t\t"); 64 | printf("\xDB\xDB\xDB\xDB\xB2 1. Add Books "); 65 | printf("\n\n\t\t"); 66 | printf("\xDB\xDB\xDB\xDB\xB2 2. Delete books"); 67 | printf("\n\n\t\t"); 68 | printf("\xDB\xDB\xDB\xDB\xB2 3. Search Books"); 69 | printf("\n\n\t\t"); 70 | printf("\xDB\xDB\xDB\xDB\xB2 4. Issue Books"); 71 | printf("\n\n\t\t"); 72 | printf("\xDB\xDB\xDB\xDB\xB2 5. View Book list"); 73 | printf("\n\n\t\t"); 74 | printf("\xDB\xDB\xDB\xDB\xB2 6. Edit Book's Record"); 75 | printf("\n\n\t\t"); 76 | printf("\xDB\xDB\xDB\xDB\xB2 7. Close Application"); 77 | printf("\n\n\t\t"); 78 | printf("\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB\xDB"); 79 | printf(" \n\n\t\tPlease Enter your choice : "); 80 | switch (getch()) 81 | { 82 | case '1': 83 | addbooks(); 84 | break; 85 | case '2': 86 | deletebooks(); 87 | break; 88 | case '3': 89 | searchbooks(); 90 | break; 91 | case '4': 92 | issuebooks(); 93 | break; 94 | case '5': 95 | viewbooks(); 96 | break; 97 | case '6': 98 | editbooks(); 99 | break; 100 | case '7': 101 | { 102 | system("cls"); 103 | printf("\n\n\n\n\n\t\t"); 104 | printf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2 THANKS!! TO BE A PART OF OUR LIBRARY \xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2"); 105 | Sleep(3000); 106 | exit(0); 107 | } 108 | default: 109 | { 110 | printf("\n\n\t\t"); 111 | printf("\a\a Wrong Choice !!! Plesae Choose the correct OPTION"); 112 | Sleep(2000); 113 | mainmenu(); 114 | } 115 | } 116 | } 117 | void addbooks(void) 118 | { 119 | system("cls"); 120 | int i; 121 | int g; 122 | printf("\n\n\n\t\t"); 123 | printf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2 SELECT CATEGOIES \xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2"); 124 | printf("\n\n\n\t\t"); 125 | printf("\xDB\xDB\xDB\xDB\xB2 1. Computer"); 126 | printf("\n\n\t\t"); 127 | printf("\xDB\xDB\xDB\xDB\xB2 2. Electronics"); 128 | printf("\n\n\t\t"); 129 | printf("\xDB\xDB\xDB\xDB\xB2 3. Electrical"); 130 | printf("\n\n\t\t"); 131 | printf("\xDB\xDB\xDB\xDB\xB2 4. Civil"); 132 | printf("\n\n\t\t"); 133 | printf("\xDB\xDB\xDB\xDB\xB2 5. Mechanical"); 134 | printf("\n\n\t\t"); 135 | printf("\xDB\xDB\xDB\xDB\xB2 6. Architecture"); 136 | printf("\n\n\t\t"); 137 | printf("\xDB\xDB\xDB\xDB\xB2 7. Back to main menu"); 138 | printf("\n\n\t\t"); 139 | printf("\n\t\t\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2"); 140 | printf("\n\n\t\t"); 141 | printf("Enter your choice:"); 142 | scanf("%d", &s); 143 | if (s == 7) 144 | { 145 | mainmenu(); 146 | } 147 | system("cls"); 148 | fp = fopen("SATYAMs.dat", "ab+"); 149 | if (getdata() == 1) 150 | { 151 | a.cat = catagories[s - 1]; 152 | fseek(fp, 0, SEEK_END); 153 | fwrite(&a, sizeof(a), 1, fp); 154 | fclose(fp); 155 | system("cls"); 156 | printf("\n\n\n\n\n\n\t\t\t\t RECORD SAVING"); 157 | for (g = 0; g < 5; g++) 158 | { 159 | Sleep(300); 160 | printf("."); 161 | } 162 | system("cls"); 163 | printf("\n\n\n\n\n\n\t\t\t\t RECORD SAVING"); 164 | for (g = 0; g < 5; g++) 165 | { 166 | Sleep(300); 167 | printf("."); 168 | } 169 | 170 | system("cls"); 171 | printf("\n\n\n\n\n\n\t\t\t\t RECORD SAVING"); 172 | for (g = 0; g < 5; g++) 173 | { 174 | Sleep(300); 175 | printf("."); 176 | } 177 | system("cls"); 178 | printf("\n\n\n\n\n\t\t @@@@@@ Record Saved Successfully @@@@@@"); 179 | printf("\n\n\n\t\t"); 180 | printf("Do You Want To Save Any More Records (Y/N)????:"); 181 | if (getch() == 'n') 182 | mainmenu(); 183 | else 184 | system("cls"); 185 | addbooks(); 186 | } 187 | } 188 | void deletebooks() 189 | { 190 | system("cls"); 191 | int d; 192 | char another = 'y'; 193 | while (another == 'y' || another == 'Y') 194 | { 195 | system("cls"); 196 | printf("\n\n\n\t\t\t"); 197 | printf("Enter the Book ID to delete:\n\n\t\t\t\t\t"); 198 | scanf("%d", &d); 199 | fp = fopen("SATYAMs.dat", "rb+"); 200 | rewind(fp); 201 | while (fread(&a, sizeof(a), 1, fp) == 1) 202 | { 203 | if (a.id == d) 204 | { 205 | 206 | printf("\n\n\n\t\t"); 207 | printf(" \xB2\xB2\xB2 The book record is available \xB2\xB2\xB2"); 208 | printf("\n\n\n\t\t"); 209 | printf("\xB2\xB2 Book name is: %s", a.name); 210 | printf("\n\n\n\t\t"); 211 | printf("\xB2\xB2 Rack No. is: %d", a.rackno); 212 | findbook = 't'; 213 | } 214 | } 215 | if (findbook != 't') 216 | { 217 | printf("\n\n\n\t\t"); 218 | printf("No Record is found please modify the search"); 219 | if (getch()) 220 | mainmenu(); 221 | } 222 | if (findbook == 't') 223 | { 224 | printf("\n\n\n\t\t"); 225 | printf("Do you want to DELETE it? (Y/N): "); 226 | if (getch() == 'y') 227 | { 228 | ft = fopen("Stests.dat", "wb+"); 229 | rewind(fp); 230 | while (fread(&a, sizeof(a), 1, fp) == 1) 231 | { 232 | if (a.id != d) 233 | { 234 | fseek(ft, 0, SEEK_CUR); 235 | fwrite(&a, sizeof(a), 1, ft); 236 | } 237 | } 238 | fclose(ft); 239 | fclose(fp); 240 | remove("SATYAMs.dat"); 241 | rename("Stests.dat", "SATYAMs.dat"); 242 | fp = fopen("SATYAMs.dat", "rb+"); 243 | if (findbook == 't') 244 | { 245 | printf("\n\n\n\n\t\t"); 246 | printf("The record is sucessfully deleted"); 247 | printf("\n\n\n\t\t"); 248 | system("cls"); 249 | printf("Do You Want To \"DELETE\" Any Other Record?(Y/N)"); 250 | } 251 | } 252 | else 253 | mainmenu(); 254 | fflush(stdin); 255 | another = getch(); 256 | } 257 | } 258 | printf("\n\t\t"); 259 | mainmenu(); 260 | } 261 | void searchbooks() 262 | { 263 | system("cls"); 264 | int d; 265 | int g; 266 | printf("\n\n\t\t\t\xDB\xDB\xDB\xDB\xB2 SEARCH BOOKS \xDB\xDB\xDB\xDB\xB2"); 267 | printf("\n\n\n\n\t\t\t\xDB\xDB\xDB\xB2 1. Search by ID"); 268 | printf("\n\n\n\t\t\t\xDB\xDB\xDB\xB2 2. Search by Name"); 269 | printf("\n\n\n \t\t\tEnter Your Choice: "); 270 | fp = fopen("SATYAMs.dat", "rb+"); 271 | rewind(fp); 272 | switch (getch()) 273 | { 274 | case '1': 275 | { 276 | system("cls"); 277 | printf("\n\n\t\t\t @@@@@ Search Books By Id @@@@@"); 278 | printf("\n\n\n\t\t\t\tEnter the book id: \n\n\t\t\t\t\t"); 279 | scanf("%d", &d); 280 | system("cls"); 281 | printf("\n\n\n\t\t\t\tSearching"); 282 | for (g = 0; g < 3; g++) 283 | { 284 | printf("."); 285 | Sleep(500); 286 | } 287 | system("cls"); 288 | printf("\n\n\n\t\t\t\tSearching"); 289 | for (g = 0; g < 3; g++) 290 | { 291 | printf("."); 292 | Sleep(500); 293 | } 294 | system("cls"); 295 | while (fread(&a, sizeof(a), 1, fp) == 1) 296 | { 297 | if (a.id == d) 298 | { 299 | system("cls"); 300 | printf("\n\n\t\t\tThe Book is available"); 301 | printf("\n\n\t\t\t\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2"); 302 | printf("\n\n\t\t\t\xB2\xB2\xB2 ID: %d", a.id); 303 | printf("\n\n\t\t\t\xB2\xB2\xB2 Name: %s", a.name); 304 | printf("\n\n\t\t\t\xB2\xB2\xB2 Author: %s ", a.Author); 305 | printf("\n\n\t\t\t\xB2\xB2\xB2 Qantity: %d ", a.quantity); 306 | printf("\n\n\t\t\t\xB2\xB2\xB2 Price: %.2f", a.Price); 307 | printf("\n\n\t\t\t\xB2\xB2\xB2 Rack No.: %d ", a.rackno); 308 | findbook = 't'; 309 | } 310 | } 311 | if (findbook != 't') 312 | { 313 | system("cls"); 314 | printf("\n\n\n\n\n\t\t\t\tNo Record Found"); 315 | Sleep(2000); 316 | } 317 | printf("\n\n\n\t\t\t Do You Want To Search Another Book? (Y/N)"); 318 | if (getch() == 'y' || getch() == 'Y') 319 | searchbooks(); 320 | else 321 | mainmenu(); 322 | break; 323 | } 324 | case '2': 325 | { 326 | char s[15]; 327 | system("cls"); 328 | printf("\n\n\t\t\t @@@@@ Search Books By Name @@@@@"); 329 | printf("\n\n\t\t\t\tEnter Book Name : \n\n\t\t\t\t\t"); 330 | gets(s); 331 | int d = 0; 332 | while (fread(&a, sizeof(a), 1, fp) == 1) 333 | { 334 | if (strcmpi(a.name, (s)) == 0) 335 | { 336 | system("cls"); 337 | printf("\n\n\t\t\tThe Book is available"); 338 | printf("\n\n\t\t\t\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2"); 339 | printf("\n\n\t\t\t\xB2\xB2\xB2 ID: %d", a.id); 340 | printf("\n\n\t\t\t\xB2\xB2\xB2 Name:%s", a.name); 341 | printf("\n\n\t\t\t\xB2\xB2\xB2 Author:%s ", a.Author); 342 | printf("\n\n\t\t\t\xB2\xB2\xB2 Qantity:%d ", a.quantity); 343 | printf("\n\n\t\t\t\xB2\xB2\xB2 Price: %.2f", a.Price); 344 | printf("\n\n\t\t\t\xB2\xB2\xB2 Rack No. :%d ", a.rackno); 345 | d++; 346 | } 347 | } 348 | if (d == 0) 349 | { 350 | printf("\n\n\n\n\n\t\t\t\tNo Record Found"); 351 | Sleep(2000); 352 | } 353 | //system("cls"); 354 | printf("\n\n\n\t\t\t Do You Want To Search Another Book ? (Y/N)"); 355 | if (getch() == 'y' || getch() == 'Y') 356 | searchbooks(); 357 | else 358 | mainmenu(); 359 | break; 360 | } 361 | default: 362 | getch(); 363 | searchbooks(); 364 | } 365 | fclose(fp); 366 | } 367 | void issuebooks(void) 368 | { 369 | int t; 370 | system("cls"); 371 | printf("\n\n\n\n\t\t\t\t\xDB\xDB\xDB\xDb\xB2 ISSUE SECTION \xDB\xDB\xDB\xDb\xB2 "); 372 | printf("\n\n\n\t\t\t\t\xDB\xDB\xDB\xDb\xB2 1. Issue a Book"); 373 | printf("\n\n\t\t\t\t\xDB\xDB\xDB\xDb\xB2 2. View Issued Book"); 374 | printf("\n\n\t\t\t\t\xDB\xDB\xDB\xDb\xB2 3. Search Issued Book"); 375 | printf("\n\n\t\t\t\t\xDB\xDB\xDB\xDb\xB2 4. Remove Issued Book"); 376 | printf("\n\n\n\t\t\t\tEnter a Choice : "); 377 | switch (getch()) 378 | { 379 | case '1': 380 | { 381 | system("cls"); 382 | int c = 0; 383 | char another = 'y'; 384 | while (another == 'y' || another == 'Y') 385 | { 386 | system("cls"); 387 | printf("\n\n\n\n\n\t\t\t\t@@@@ Issue Book section @@@@"); 388 | printf("\n\n\n\t\t\t\tEnter the Book Id : "); 389 | scanf("%d", &t); 390 | fp = fopen("SATYAMs.dat", "rb"); 391 | fs = fopen("IssueSs.dat", "ab+"); 392 | if (checkid(t) == 0) 393 | { 394 | system("cls"); 395 | printf("\n\n\n\n\n\t\t\tThe book Record is Available: "); 396 | printf("\n\n\t\t\tThere are %d unissued books in library: ", a.quantity); 397 | printf("\n\n\n\t\t\tThe name of book is: %s", a.name); 398 | printf("\n\n\n\t\t\tEnter student name: "); 399 | gets(a.stname); 400 | printf("\n\n\t\t\tThe BOOK of ID %d is ISSUED", a.id); 401 | time_t t = time(NULL); 402 | struct tm tm = *localtime(&t); 403 | a.issued.dd = tm.tm_mday; 404 | a.issued.mm = tm.tm_mon + 1; 405 | a.issued.yy = tm.tm_year + 1900; 406 | printf("\n\n\t\t\tIssued date=%d-%d-%d", a.issued.dd, a.issued.mm, a.issued.yy); 407 | a.duedate.dd = a.issued.dd + RETURNTIME; 408 | a.duedate.mm = a.issued.mm; 409 | a.duedate.yy = a.issued.yy; 410 | if (a.duedate.dd > 30) 411 | { 412 | a.duedate.mm = a.duedate.mm + a.duedate.dd / 30; 413 | a.duedate.dd = a.duedate.dd - 30; 414 | } 415 | if (a.duedate.mm > 12) 416 | { 417 | a.duedate.yy = a.duedate.yy + a.duedate.mm / 12; 418 | a.duedate.mm = a.duedate.mm - 12; 419 | } 420 | printf("\n\n\t\t\tTo be RETURN: %d-%d-%d", a.duedate.dd, a.duedate.mm, a.duedate.yy); 421 | fseek(fs, sizeof(a), SEEK_END); 422 | fwrite(&a, sizeof(a), 1, fs); 423 | fclose(fs); 424 | c = 1; 425 | } 426 | if (c == 0) 427 | { 428 | printf("\n\n\t\t\t\t\tNo Record Found"); 429 | } 430 | printf("\n\n\n\n\n\t\t\t\tDo you want to issue any more books (Y/N):"); 431 | fflush(stdin); 432 | another = getche(); 433 | fclose(fp); 434 | } 435 | break; 436 | } 437 | case '2': 438 | { 439 | system("cls"); 440 | int j = 4; 441 | printf("\n\n\n\n\t\t\t\t @@@@ Issued Book List @@@@\n"); 442 | fs = fopen("IssueSs.dat", "rb"); 443 | while (fread(&a, sizeof(a), 1, fs) == 1) 444 | { 445 | printf("\n\n\n\n\t\t\t CATEGORY: %s", a.cat); 446 | printf("\n\n\t\t\t Id: %d", a.id); 447 | printf("\n\n\t\t\t BOOK NAME: %s", a.name); 448 | printf("\n\n\t\t\t ISSUED DATE: %d-%d-%d", a.issued.dd, a.issued.mm, a.issued.yy); 449 | printf("\n\n\t\t\t RETURN DATE: %d-%d-%d", a.duedate.dd, a.duedate.mm, a.duedate.yy); 450 | printf("\n\n\t\t\t STUDENT NAME: %s", a.stname); 451 | } 452 | fclose(fs); 453 | returnfunc(); 454 | } 455 | break; 456 | case '3': 457 | { 458 | system("cls"); 459 | printf("\n\n\n\n\n\t\t\t\tEnter Book ID: \n\n\t\t\t\t"); 460 | int p, c = 0; 461 | char another = 'y'; 462 | while (another == 'y' || another == 'Y') 463 | { 464 | scanf("%d", &p); 465 | fs = fopen("IssueSs.dat", "rb"); 466 | while (fread(&a, sizeof(a), 1, fs) == 1) 467 | { 468 | if (a.id == p) 469 | { 470 | issuerecord(); 471 | printf("\n\n\n\n\t\t\t\tPress \"Any key\""); 472 | getch(); 473 | issuerecord(); 474 | c = 1; 475 | } 476 | } 477 | fflush(stdin); 478 | fclose(fs); 479 | if (c == 0) 480 | { 481 | system("cls"); 482 | printf("\n\n\t\t\t\tNo Record Found"); 483 | Sleep(2000); 484 | } 485 | system("cls"); 486 | printf("\n\n\t\t\t\tDo You Want to search Any other Book?(Y/N)"); 487 | another = getch(); 488 | } 489 | } 490 | break; 491 | case '4': 492 | { 493 | system("cls"); 494 | int b; 495 | FILE *fg; 496 | char another = 'y'; 497 | while (another == 'y' || another == 'Y') 498 | { 499 | printf("\n\n\t\t\t\tEnter BOOK ID TO \"REMOVE\": \n\n\t\t\t\t"); 500 | scanf("%d", &b); 501 | fs = fopen("IssueSs.dat", "rb+"); 502 | while (fread(&a, sizeof(a), 1, fs) == 1) 503 | { 504 | if (a.id == b) 505 | { 506 | issuerecord(); 507 | findbook = 't'; 508 | } 509 | if (findbook == 't') 510 | { 511 | printf("\n\n\n\t\t\t\tDo You Want to REMOVE it? (Y/N)"); 512 | if (getch() == 'y') 513 | { 514 | fg = fopen("recordSs.dat", "wb+"); 515 | rewind(fs); 516 | while (fread(&a, sizeof(a), 1, fs) == 1) 517 | { 518 | if (a.id != b) 519 | { 520 | fseek(fs, 0, SEEK_CUR); 521 | fwrite(&a, sizeof(a), 1, fg); 522 | } 523 | } 524 | fclose(fs); 525 | fclose(fg); 526 | remove("IssueSs.dat"); 527 | rename("recordSs.dat", "IssueSs.dat"); 528 | system("cls"); 529 | printf("\n\n\n\n\n\t\t\t\tThe Issued Book is REMOVED from list"); 530 | system("cls"); 531 | } 532 | } 533 | if (findbook != 't') 534 | { 535 | printf("\n\n\n\n\t\t\t\tNo Record Found"); 536 | } 537 | } 538 | system("cls"); 539 | printf("\n\n\n\n\n\t\t\t\tDo You Want to DELETE Any Other Record? (Y/N)"); 540 | another = getch(); 541 | } 542 | } 543 | break; 544 | default: 545 | system("cls"); 546 | printf("\n\n\n\n\n\t\t\t\t\aWrong Entry!"); 547 | getch(); 548 | issuebooks(); 549 | break; 550 | } 551 | returnfunc(); 552 | } 553 | void viewbooks(void) 554 | { 555 | int i = 0, j; 556 | system("cls"); 557 | printf("\n\n\t\t\t@@@@@ Book List @@@@@"); 558 | fp = fopen("SATYAMs.dat", "rb"); 559 | while (fread(&a, sizeof(a), 1, fp) == 1) 560 | { 561 | printf("\n\n\n\n\t\t\t CATEGORY: %s", a.cat); 562 | printf("\n\n\t\t\t Id: %d", a.id); 563 | printf("\n\n\t\t\t BOOK NAME: %s", a.name); 564 | printf("\n\n\t\t\t AUTHOR: %s", a.Author); 565 | printf("\n\n\t\t\t QTY: %d", a.quantity); 566 | printf("\n\n\t\t\t PRICE: %.2f", a.Price); 567 | printf("\n\n\t\t\t RACK NO.: %d", a.rackno); 568 | printf("\n\n\n"); 569 | i = i + a.quantity; 570 | } 571 | printf("\n\n\tTotal Books = %d", i); 572 | fclose(fp); 573 | returnfunc(); 574 | } 575 | void editbooks(void) 576 | { 577 | system("cls"); 578 | int c = 0; 579 | int d, e; 580 | int g; 581 | printf("\n\n\t\t\t\t@@@@ Edit Books Section @@@@"); 582 | char another = 'y'; 583 | while (another == 'y' || another == 'Y') 584 | { 585 | system("cls"); 586 | printf("\n\n\t\t\t\tEnter Book Id to be EDITED: \n\n\t\t\t\t\t"); 587 | scanf("%d", &d); 588 | fp = fopen("SATYAMs.dat", "rb+"); 589 | while (fread(&a, sizeof(a), 1, fp) == 1) 590 | { 591 | if (checkid(d) == 0) 592 | { 593 | printf("\n\n\t\t\t\tThe BOOK is AVAILABLE"); 594 | printf("\n\n\t\t\t\tThe Book ID: %d", a.id); 595 | fflush(stdin); 596 | printf("\n\n\t\t\t\tEnter New Book Name: "); 597 | gets(a.name); 598 | printf("\n\n\t\t\t\tEnter New Author Name: "); 599 | gets(a.Author); 600 | fflush(stdin); 601 | printf("\n\n\t\t\t\tEnter New Quantity: "); 602 | scanf("%d", &a.quantity); 603 | printf("\n\n\t\t\t\tEnter New Price: "); 604 | scanf("%f", &a.Price); 605 | printf("\n\n\t\t\t\tEnter New Rack No.: "); 606 | scanf("%d", &a.rackno); 607 | system("cls"); 608 | printf("\n\n\n\n\n\t\t\t\t Record is Modifying "); 609 | for (g = 0; g < 4; g++) 610 | { 611 | Sleep(300); 612 | printf("."); 613 | } 614 | system("cls"); 615 | printf("\n\n\n\n\n\t\t\t\t Record is Modifying "); 616 | for (g = 0; g < 4; g++) 617 | { 618 | Sleep(300); 619 | printf("."); 620 | } 621 | system("cls"); 622 | 623 | printf("\n\n\n\n\n\t\t\t\t Record is Modifying "); 624 | for (g = 0; g < 4; g++) 625 | { 626 | Sleep(300); 627 | printf("."); 628 | } 629 | system("cls"); 630 | printf("\n\n\n\n\n\t\t\t\tThe Record is Modified"); 631 | Sleep(2000); 632 | fseek(fp, ftell(fp) - sizeof(a), 0); 633 | fwrite(&a, sizeof(a), 1, fp); 634 | fclose(fp); 635 | c = 1; 636 | } 637 | if (c == 0) 638 | { 639 | system("cls"); 640 | printf("\n\n\n\n\t\t\t\t No Record Found "); 641 | Sleep(2000); 642 | } 643 | } 644 | system("cls"); 645 | printf("\n\n\n\n\t\t\t\tDo You Want To Modify another Record? (Y/N)"); 646 | fflush(stdin); 647 | another = getch(); 648 | } 649 | returnfunc(); 650 | } 651 | void returnfunc(void) 652 | { 653 | { 654 | printf("\n\n\n\n\t\t\t Press \"ENTER\" To Return To \"MAIN MENU\""); 655 | } 656 | a: 657 | if (getch() == 13) 658 | mainmenu(); 659 | else 660 | goto a; 661 | } 662 | int getdata() 663 | { 664 | int t; 665 | printf("\n\n\n\t\t\t"); 666 | printf("Enter the Information Below"); 667 | printf("\n\n\t\t\t\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2"); 668 | printf("\n\n\n\t\t\t\xB2\xB2\xB2\xB2 Category : "); 669 | printf("%s ", catagories[s - 1]); 670 | printf("\n\n\n\t\t\t\xB2\xB2\xB2\xB2 Book ID : "); 671 | scanf("%d", &t); 672 | if (checkid(t) == 0) 673 | { 674 | printf("\n\n\n\t\t\t"); 675 | printf("\aThe BOOK ID \"ALREADY EXIST\"\a"); 676 | getch(); 677 | mainmenu(); 678 | return 0; 679 | } 680 | a.id = t; 681 | fflush(stdin); 682 | printf("\n\n\t\t\t\xB2\xB2\xB2\xB2 Book Name: "); 683 | gets(a.name); 684 | fflush(stdin); 685 | printf("\n\n\t\t\t\xB2\xB2\xB2\xB2 Author Name : "); 686 | gets(a.Author); 687 | fflush(stdin); 688 | printf("\n\n\t\t\t\xB2\xB2\xB2\xB2 Quantity : "); 689 | scanf("%d", &a.quantity); 690 | fflush(stdin); 691 | printf("\n\n\t\t\t\xB2\xB2\xB2\xB2 Price : "); 692 | scanf("%f", &a.Price); 693 | fflush(stdin); 694 | printf("\n\n\t\t\t\xB2\xB2\xB2\xB2 Rack No. : "); 695 | scanf("%d", &a.rackno); 696 | fflush(stdin); 697 | return 1; 698 | } 699 | int checkid(int t) 700 | { 701 | rewind(fp); 702 | while (fread(&a, sizeof(a), 1, fp) == 1) 703 | if (a.id == t) 704 | return 0; 705 | return 1; 706 | } 707 | int t(void) 708 | { 709 | time_t t; 710 | time(&t); 711 | printf("\n\t\tDATE and TIME:%s", ctime(&t)); 712 | return 0; 713 | } 714 | void Password(void) 715 | { 716 | 717 | system("cls"); 718 | char ch, pass[10]; 719 | int i = 0, j, g; 720 | system("color 1f"); 721 | printf("\n\n\n\n\n\t\t\t !!!! PASSWORD PROTECTED SYSTEM !!!!"); 722 | printf("\n\n\n\n\t\t\t PLEASE ENTER THE SECURITY CODE :"); 723 | printf("\n\n\t\t\t\t\t"); 724 | pass[i] = getch(); 725 | while (pass[i] != '\r') 726 | { 727 | if (pass[i] == '\b') 728 | { 729 | i--; 730 | printf("\b"); 731 | printf(" "); 732 | printf("\b"); 733 | pass[i] = getch(); 734 | } 735 | else 736 | { 737 | printf("*"); 738 | i++; 739 | pass[i] = getch(); 740 | } 741 | } 742 | pass[i] = '\0'; 743 | if (strcmpi(pass, password) == 0) 744 | { 745 | 746 | system("cls"); 747 | printf("\n\n\n\n\n\n\t\t\t\t Matching"); 748 | for (g = 0; g < 4; g++) 749 | { 750 | Sleep(500); 751 | printf("."); 752 | } 753 | system("cls"); 754 | printf("\n\n\n\n\n\n\t\t\t\t Matching"); 755 | for (g = 0; g < 4; g++) 756 | { 757 | Sleep(500); 758 | printf("."); 759 | } 760 | system("cls"); 761 | printf("\n\n\n\n\n\n\t\t\t\t Matching"); 762 | for (g = 0; g < 4; g++) 763 | { 764 | Sleep(500); 765 | printf("."); 766 | } 767 | system("cls"); 768 | printf("\n\n\n\n\n\t\t\t WELCOME !!!! SECURITY CODE MATCH"); 769 | Sleep(2000); 770 | mainmenu(); 771 | } 772 | else 773 | { 774 | system("cls"); 775 | printf("\n\n\n\n\n\n\t\t\t\t Matching"); 776 | for (g = 0; g < 4; g++) 777 | { 778 | Sleep(500); 779 | printf("."); 780 | } 781 | system("cls"); 782 | printf("\n\n\n\n\n\n\t\t\t\t Matching"); 783 | for (g = 0; g < 4; g++) 784 | { 785 | Sleep(500); 786 | printf("."); 787 | } 788 | 789 | system("cls"); 790 | printf("\n\n\n\n\n\n\t\t\t\t Matching"); 791 | for (g = 0; g < 4; g++) 792 | { 793 | Sleep(500); 794 | printf("."); 795 | } 796 | system("color 4f"); 797 | system("cls"); 798 | printf("\n\n\n\n\n\n\n\n\t\t\t WARNING !! Incorrect Security Code ??"); 799 | getch(); 800 | Password(); 801 | } 802 | } 803 | void issuerecord() 804 | { 805 | system("cls"); 806 | printf("\n\n\t\t\t\tThe Book has taken by Mr. %s", a.stname); 807 | printf("\n\n\t\t\t\tIssued Date:%d-%d-%d", a.issued.dd, a.issued.mm, a.issued.yy); 808 | printf("\n\n\t\t\t\tReturning Date:%d-%d-%d", a.duedate.dd, a.duedate.mm, a.duedate.yy); 809 | } 810 | -------------------------------------------------------------------------------- /Mini Projects/MS Word/MS_Word.c: -------------------------------------------------------------------------------- 1 | // Note: Try to run this Code on DEV-C++ 2 | 3 | #include 4 | #include 5 | #include 6 | int main() 7 | { 8 | char a[100], ch; 9 | int l, i, g; 10 | char h[100] = {"$$$$$$ thanks for using this \" $$$$$$"}; 11 | system("color f0"); 12 | while (1) 13 | { 14 | system("cls"); 15 | printf("\n\n\t\t\t [[[]]] Enter Any String [[[]]] \n\n\t\t\t\t\t"); 16 | gets(a); 17 | printf("\n\n\n\t\t PRESS The Numbers From 1 To 6 and do your task :\n\n\n\n\n\t[1]. \"UPPER CASE\" [2]. \"LOWER CASE\" [3]. \"TOGGLE CASE\"\n\n\n\t\t [4]. \"SENTENCE CASE\" [5]. \"WORD CASE\"\n\n\n\t\t\t\t 6. \"EXIT\"\n"); 18 | ch = getch(); 19 | if (ch == '1') 20 | goto x; 21 | if (ch == '2') 22 | goto y; 23 | if (ch == '3') 24 | goto z; 25 | if (ch == '4') 26 | goto g; 27 | if (ch == '6') 28 | goto b; 29 | if (ch == '5') 30 | goto sat; 31 | else 32 | goto j; 33 | switch (ch) 34 | { 35 | x: 36 | case 1: 37 | l = strlen(a); 38 | for (i = 0; i < l; i++) 39 | { 40 | if (a[i] >= 'a' && a[i] <= 'z') 41 | { 42 | a[i] = a[i] - 32; 43 | } 44 | } 45 | a[i + 1] = '\0'; 46 | system("cls"); 47 | //printf("\n\n\t\t\t\t\t"); 48 | printf("\n\n\t\t\t\tString After Conversion"); 49 | printf("\n\t\t\t=====----------------------------======"); 50 | printf("\n\n\n\t\t\t\t\t"); 51 | for (i = 0; a[i] != '\0'; i++) 52 | { 53 | 54 | printf("%c", a[i]); 55 | } 56 | printf("\n\n\n\n\t\t\tPress Any Key to return to \"MAIN MENU\"...\n\n"); 57 | ch = getch(); 58 | break; 59 | y: 60 | case 2: 61 | l = strlen(a); 62 | for (i = 0; i < l; i++) 63 | { 64 | if (a[i] >= 'A' && a[i] <= 'Z') 65 | { 66 | a[i] = a[i] + 32; 67 | } 68 | } 69 | a[i + 1] = '\0'; 70 | system("cls"); 71 | //printf("\n\n\t\t\t\t\t"); 72 | printf("\n\n\t\t\t\tString After Conversion"); 73 | printf("\n\t\t\t=====----------------------------======"); 74 | printf("\n\n\n\t\t\t\t\t"); 75 | for (i = 0; a[i] != '\0'; i++) 76 | { 77 | 78 | printf("%c", a[i]); 79 | } 80 | printf("\n\n\n\n\t\t\tPress Any Key to return to \"MAIN MENU\"...\n\n"); 81 | ch = getch(); 82 | break; 83 | z: 84 | case 3: 85 | l = strlen(a); 86 | for (i = 0; i < l; i++) 87 | { 88 | if (a[i] >= 'a' && a[i] <= 'z') 89 | { 90 | a[i] = a[i] - 32; 91 | } 92 | else if (a[i] == ' ') 93 | continue; 94 | else 95 | a[i] = a[i] + 32; 96 | } 97 | a[i + 1] = '\0'; 98 | system("cls"); 99 | printf("\n\n\t\t\t\tString After Conversion"); 100 | printf("\n\t\t\t=====----------------------------======"); 101 | printf("\n\n\n\t\t\t\t\t"); 102 | for (i = 0; a[i] != '\0'; i++) 103 | { 104 | printf("%c", a[i]); 105 | } 106 | printf("\n\n\n\n\t\t\tPress Any Key to return to \"MAIN MENU\"...\n\n"); 107 | ch = getch(); 108 | break; 109 | g: 110 | case 4: 111 | l = strlen(a); 112 | for (i = 0; i < l; i++) 113 | { 114 | if (i == 0 && (a[i] >= 'a' && a[i] <= 'z')) 115 | { 116 | a[i] = a[i] - 32; 117 | } 118 | else if (a[i] == '.') 119 | { 120 | if (a[i + 1] == ' ') 121 | { 122 | if (a[i + 2] >= 'a' && a[i + 2] <= 'z') 123 | { 124 | a[i + 2] = a[i + 2] - 32; 125 | } 126 | } 127 | else 128 | { 129 | if (a[i + 1] >= 'a' && a[i + 1] <= 'z') 130 | { 131 | a[i + 1] = a[i + 1] - 32; 132 | } 133 | } 134 | } 135 | } 136 | system("cls"); 137 | printf("\n\n\t\t\t\tString After Conversion"); 138 | printf("\n\t\t\t=====----------------------------======"); 139 | printf("\n\n\n\t\t\t\t"); 140 | printf("%s", a); 141 | printf("\n\n\n\n\t\t\tPress Any Key to return to \"MAIN MENU\"...\n\n"); 142 | ch = getch(); 143 | break; 144 | sat: 145 | case 6: 146 | 147 | l = strlen(a); 148 | for (i = 0; i < l; i++) 149 | { 150 | if (i == 0 && (a[i] >= 'a' && a[i] <= 'z')) 151 | { 152 | a[i] = a[i] - 32; 153 | } 154 | else if (a[i] == ' ') 155 | { 156 | if (a[i + 1] == ' ') 157 | { 158 | if (a[i + 2] >= 'a' && a[i + 2] <= 'z') 159 | { 160 | a[i + 2] = a[i + 2] - 32; 161 | } 162 | } 163 | else 164 | { 165 | if (a[i + 1] >= 'a' && a[i + 1] <= 'z') 166 | { 167 | a[i + 1] = a[i + 1] - 32; 168 | } 169 | } 170 | } 171 | } 172 | system("cls"); 173 | printf("\n\n\t\t\t\tString After Conversion"); 174 | printf("\n\t\t\t=====----------------------------======"); 175 | printf("\n\n\n\t\t\t\t"); 176 | printf("%s", a); 177 | printf("\n\n\n\n\t\t\tPress Any Key to return to \"MAIN MENU\"...\n\n"); 178 | ch = getch(); 179 | break; 180 | b: 181 | case 5: 182 | system("cls"); 183 | printf("\n\n\n\n\n\n\n\n\t\t\t"); 184 | for (g = 0; g < strlen(h); g++) 185 | { 186 | system("color 1f"); 187 | printf("%c", h[g]); 188 | Sleep(30); 189 | if (h[g] >= 97 && h[g] <= 122) 190 | { 191 | h[g] = h[g] - 32; 192 | printf("\b%c", h[g]); 193 | Sleep(30); 194 | } 195 | } 196 | Sleep(3000); 197 | exit(1); 198 | j: 199 | default: 200 | system("cls"); 201 | printf("\n\n\n\t\t\t\t Error!!!!!!"); 202 | printf("\n\n\t\t\t\t Invalid Option !! Please try Again..."); 203 | Sleep(1000); 204 | exit(1); 205 | } 206 | } 207 | } 208 | -------------------------------------------------------------------------------- /Mini Projects/Media Player/Media_Player.c: -------------------------------------------------------------------------------- 1 | // Note: Try to run this Code on DEV-C++ 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | int main() 8 | { 9 | system("color F0"); 10 | char a[50], temp, tem[50], word[50]; 11 | char b[50], rev[50], ch; 12 | int i = 0, j = 0, count = 0, choice, cot = 0, vowel = 0, digit = 0, conso = 0, special = 0, space = 0, kota, len = 0; 13 | 14 | while (1) 15 | { 16 | system("cls"); 17 | printf("\t ##########################################################"); 18 | printf("\n\t ############ Welcome To ############"); 19 | printf("\n\t ############ The ############"); 20 | printf("\n\t ############ Music System ############"); 21 | printf("\n\t ##########################################################"); 22 | //sleep(4); 23 | //system("cls"); 24 | printf("\n\n\n\t\t Please Enter the Song Number that you want to PLAY"); 25 | printf("\n\n\n\t\t[1]. Dil Vich.."); 26 | printf("\t\t\t[2]. Khaab.."); 27 | printf("\n\n\n\t\t[3]. Fevicol Se.."); 28 | printf("\t\t[4]. Despacito.."); 29 | printf("\n\n\n\t\t[5]. Lahore.."); 30 | printf("\t\t\t[6]. O Saathi.."); 31 | printf("\n\n\n\t\t[7]. Shekh chilli.."); 32 | printf("\t\t[8]. Teri Mitti.."); 33 | ch = getch(); 34 | if (ch == '1') 35 | goto x; 36 | else if (ch == '2') 37 | goto a; 38 | else if (ch == '3') 39 | goto b; 40 | else if (ch == '4') 41 | goto c; 42 | else if (ch == '5') 43 | goto d; 44 | else if (ch == '6') 45 | goto e; 46 | else if (ch == '7') 47 | goto f; 48 | else if (ch == '8') 49 | goto g; 50 | else 51 | goto h; 52 | switch (choice) 53 | { 54 | 55 | x: 56 | 57 | case 1: 58 | system("dilvich.mp3"); 59 | break; 60 | a: 61 | case 2: 62 | system("khaab.mp3"); 63 | break; 64 | b: 65 | case 3: 66 | system("fevicolse.mp3"); 67 | break; 68 | case 4: 69 | system("cls"); 70 | c: 71 | system("cls"); 72 | system("despacito.mp3"); 73 | break; 74 | d: 75 | case 5: 76 | system("cls"); 77 | system("Lahore.mp3"); 78 | break; 79 | e: 80 | case 6: 81 | system("cls"); 82 | system("osaathi.mp3"); 83 | break; 84 | f: 85 | case 7: 86 | system("cls"); 87 | system("shekhchilli.mp3"); 88 | break; 89 | g: 90 | case 8: 91 | system("cls"); 92 | system("terimitti.mp3"); 93 | break; 94 | h: 95 | default: 96 | printf("\n Error!!!!!!"); 97 | printf("\n Invalid Option !! Please try Again..."); 98 | exit(1); 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /Mini Projects/Password Generator/Password_Generator.c: -------------------------------------------------------------------------------- 1 | // Note: Try to run this Code on DEV-C++ 2 | 3 | #include 4 | #include 5 | #include 6 | int main() 7 | { 8 | system("color f0"); 9 | int i, password, len, b; 10 | srand((unsigned int)time(NULL)); 11 | printf("\n\n\t\t\t Enter No. of Password you want !!!\n\n\t\t\t\t\t"); 12 | scanf("%d", &b); 13 | printf("\n\n\n\t\tEnter Password Length and must be greater than \"5\"\n\n\t\t\t\t\t"); 14 | scanf("%d", &len); 15 | printf("\n\n\t\t\t\t"); 16 | if (len >= 6) 17 | { 18 | system("cls"); 19 | printf("\n\n\t\t\t\tPASSWORDS ARE GIVEN BELOW !!!\n\n\t\t\t\t"); 20 | while (b--) 21 | { 22 | for (i = 0; i < len; i++) 23 | { 24 | int k = rand() % 200; 25 | if ((k >= 48 && k <= 57) || (k >= 65 && k <= 90) || (k >= 97 && k <= 122) || (k >= 35 && k <= 37) || k == 64) 26 | { 27 | printf("%c", k); 28 | } 29 | else 30 | { 31 | i--; 32 | } 33 | } 34 | printf("\n\n\t\t\t\t"); 35 | } 36 | } 37 | 38 | else 39 | { 40 | printf("\n\n\n\t\t\tLength should be greater than \"6\"\n"); 41 | } 42 | system("pause"); 43 | } 44 | -------------------------------------------------------------------------------- /Mini Projects/Smart Age Calculator/Smart_Age_Calculator.c: -------------------------------------------------------------------------------- 1 | // Note: Try to run this Code on DEV-C++ 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | int leapyear(int y1) 8 | { 9 | int i = 0; 10 | if ((y1 % 4 || y1 % 400) == 0 && y1 % 100 != 0) 11 | i++; 12 | return i; 13 | } 14 | int main() 15 | { 16 | int g; 17 | char u[100] = {"[][][] Now please enter the D.O.B [][][]"}; 18 | char v[100] = {"[[[ Enter the day ]]] "}; 19 | char w[100] = {"[[[ Enter the month ]]]"}; 20 | char h[100] = {"[[[ Enter the year ]]]"}; 21 | int d2, d3, m2, m3, y2, y3; 22 | system("color 3f"); 23 | time_t t = time(NULL); 24 | struct tm tm = *localtime(&t); 25 | printf("\n\n\t\t\t Current Date is : %02d-%02d-%02d \n", tm.tm_mday, tm.tm_mon + 1, tm.tm_year + 1900); 26 | int d1 = tm.tm_mday; 27 | int m1 = tm.tm_mon + 1; 28 | int y1 = tm.tm_year + 1900; 29 | printf("\n\n\t\t\t\t\t\t\t "); 30 | printf("\n\n\t\t "); 31 | for (g = 0; g < strlen(u); g++) 32 | { 33 | system("color 5f"); 34 | printf("%c", u[g]); 35 | Sleep(30); 36 | if (u[g] >= 97 && u[g] <= 122) 37 | { 38 | u[g] = u[g] - 32; 39 | printf("\b%c", u[g]); 40 | Sleep(30); 41 | } 42 | } 43 | Sleep(800); 44 | printf("\n\n\n\n "); 45 | for (g = 0; g < strlen(v); g++) 46 | { 47 | system("color 6f"); 48 | printf("%c", v[g]); 49 | Sleep(30); 50 | if (v[g] >= 97 && v[g] <= 122) 51 | { 52 | v[g] = v[g] - 32; 53 | printf("\b%c", v[g]); 54 | Sleep(30); 55 | } 56 | } 57 | printf("\n\n\t "); 58 | scanf("%d", &d2); 59 | printf("\t\t\t"); 60 | for (g = 0; g < strlen(w); g++) 61 | { 62 | system("color 9f"); 63 | printf("%c", w[g]); 64 | Sleep(30); 65 | if (w[g] >= 97 && w[g] <= 122) 66 | { 67 | w[g] = w[g] - 32; 68 | printf("\b%c", w[g]); 69 | Sleep(30); 70 | } 71 | } 72 | printf("\n\n\t\t\t\t "); 73 | scanf("%d", &m2); 74 | printf("\n\t\t\t\t\t\t"); 75 | for (g = 0; g < strlen(h); g++) 76 | { 77 | system("color 8f"); 78 | printf("%c", h[g]); 79 | Sleep(30); 80 | if (h[g] >= 97 && h[g] <= 122) 81 | { 82 | h[g] = h[g] - 32; 83 | printf("\b%c", h[g]); 84 | Sleep(30); 85 | } 86 | } 87 | printf("\n\n\t\t\t\t\t\t\t "); 88 | scanf("%d", &y2); 89 | year(d1, m1, y1, d2, m2, y2); 90 | } 91 | 92 | int year(int d1, int m1, int y1, int d2, int m2, int y2) 93 | { 94 | int i; 95 | int d3, y3, m3; 96 | if (m1 == 1 || m1 == 3 || m1 == 5 || m1 == 7 || m1 == 8 || m1 == 10 || m1 == 12) 97 | { 98 | if (d2 > d1) 99 | { 100 | m1 = m1 - 1; 101 | d1 = d1 + 29; 102 | } 103 | } 104 | else if (m1 == 2) 105 | { 106 | leapyear(y1); 107 | if (i == 1 && d2 > d1) 108 | { 109 | m1 = m1 - 1; 110 | d1 = d1 + 29; 111 | } 112 | else 113 | { 114 | if (i == 0 && d2 > d1) 115 | { 116 | m1 = m1 - 1; 117 | d1 = d1 + 28; 118 | } 119 | } 120 | } 121 | else 122 | { 123 | if (d2 > d1) 124 | { 125 | m1 = m1 - 1; 126 | d1 = d1 + 30; 127 | } 128 | } 129 | if (m2 > m1) 130 | { 131 | y1 = y1 - 1; 132 | m1 = m1 + 12; 133 | } 134 | if (y2 > y1) 135 | { 136 | MessageBox(0, "INVALID OPTION !! please try again !!", "EMPIRE'S World", MB_ICONWARNING); 137 | exit(1); 138 | } 139 | d3 = d1 - d2; 140 | m3 = m1 - m2; 141 | y3 = y1 - y2; 142 | system("cls"); 143 | printf("\n\n\n\n\t\t\t\tYOUR \"Age\" is : \n\n\n\t\t\tYears : %d \n\n\t\t\t\t Month : %d \n\n\t\t\t\t\t\tDay: %d ", y3, m3, d3); 144 | printf("\n\n\n\t\t\t\t"); 145 | system("pause"); 146 | } 147 | -------------------------------------------------------------------------------- /Mini Projects/Text to Binary Converter/Text_To_Binary_Converter.c: -------------------------------------------------------------------------------- 1 | // Note: Try to run this Code on DEV-C++ 2 | 3 | #include 4 | #include 5 | #include 6 | void decimalToBinary(int decimal, char *octet) 7 | { 8 | octet = octet + 8; 9 | *octet = '\0'; 10 | if (decimal == 0) 11 | { 12 | octet = octet - 8; 13 | octet = "00000000"; 14 | } 15 | else 16 | { 17 | while (decimal > 0) 18 | { 19 | octet--; 20 | *octet = decimal % 2 + '0'; 21 | decimal = decimal / 2; 22 | } 23 | } 24 | } 25 | void textToBinary(char *text, int textLength, char *binary, int binaryLength) 26 | { 27 | char *octet = malloc(8); 28 | while (*text) 29 | { 30 | decimalToBinary(*text, octet); 31 | while (*octet) 32 | *binary++ = *octet++; 33 | *binary++ = ' '; 34 | ++text; 35 | octet = octet - 8; 36 | } 37 | *binary = '\0'; 38 | free(octet); 39 | } 40 | 41 | int main() 42 | { 43 | system("color f0"); 44 | char text[101]; 45 | char *binary; 46 | int textLength, binaryLength; 47 | gets(text); 48 | textLength = strlen(text); 49 | binaryLength = textLength * 8; 50 | binary = malloc(binaryLength + 1); 51 | textToBinary(text, textLength, binary, binaryLength); 52 | printf("\n\n\n\t\t\t\t\tBINARY CODES\n\n\t%s\n\n\n\n", binary); 53 | free(binary); 54 | system("pause"); 55 | return 0; 56 | } 57 | -------------------------------------------------------------------------------- /Mini Projects/Tic Tac Toe/Tic_Tac_Toe.c: -------------------------------------------------------------------------------- 1 | // Note: Try to run this Code on DEV-C++ 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | char square[10] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}; 8 | 9 | int checkwin(); 10 | void board(); 11 | 12 | int main() 13 | { 14 | int player = 1, i, choice; 15 | 16 | char mark; 17 | 18 | do 19 | { 20 | 21 | board(); 22 | player = (player % 2) ? 1 : 2; 23 | 24 | printf("\n\t\t\t Player %d, enter a number \n\n\t\t\t\t\t", player); 25 | scanf("%d", &choice); 26 | mark = (player == 1) ? 'X' : 'O'; 27 | 28 | if (choice == 1 && square[1] == '1') 29 | square[1] = mark; 30 | else if (choice == 2 && square[2] == '2') 31 | square[2] = mark; 32 | 33 | else if (choice == 3 && square[3] == '3') 34 | square[3] = mark; 35 | 36 | else if (choice == 4 && square[4] == '4') 37 | square[4] = mark; 38 | 39 | else if (choice == 5 && square[5] == '5') 40 | square[5] = mark; 41 | 42 | else if (choice == 6 && square[6] == '6') 43 | square[6] = mark; 44 | 45 | else if (choice == 7 && square[7] == '7') 46 | square[7] = mark; 47 | 48 | else if (choice == 8 && square[8] == '8') 49 | square[8] = mark; 50 | 51 | else if (choice == 9 && square[9] == '9') 52 | square[9] = mark; 53 | else 54 | { 55 | 56 | printf("Invalid move "); 57 | 58 | player--; 59 | getch(); 60 | } 61 | i = checkwin(); 62 | 63 | player++; 64 | } while (i == -1); 65 | 66 | board(); 67 | system("color 2f"); 68 | if (i == 1) 69 | { 70 | printf("\n\n\a\a\t\t\t\t[ Player %d win ] ", --player); 71 | } 72 | else 73 | printf("\n\n\t\t\t\t\a\aGame draw"); 74 | 75 | getch(); 76 | 77 | return 0; 78 | } 79 | 80 | int checkwin() 81 | { 82 | if (square[1] == square[2] && square[2] == square[3]) 83 | return 1; 84 | 85 | else if (square[4] == square[5] && square[5] == square[6]) 86 | return 1; 87 | 88 | else if (square[7] == square[8] && square[8] == square[9]) 89 | return 1; 90 | 91 | else if (square[1] == square[4] && square[4] == square[7]) 92 | return 1; 93 | 94 | else if (square[2] == square[5] && square[5] == square[8]) 95 | return 1; 96 | 97 | else if (square[3] == square[6] && square[6] == square[9]) 98 | return 1; 99 | 100 | else if (square[1] == square[5] && square[5] == square[9]) 101 | return 1; 102 | 103 | else if (square[3] == square[5] && square[5] == square[7]) 104 | return 1; 105 | 106 | else if (square[1] != '1' && square[2] != '2' && square[3] != '3' && 107 | square[4] != '4' && square[5] != '5' && square[6] != '6' && square[7] != '7' && square[8] != '8' && square[9] != '9') 108 | 109 | return 0; 110 | else 111 | return -1; 112 | } 113 | void board() 114 | { 115 | system("cls"); 116 | printf("\n\n\t\t\t\tTic - Tac - Toe\n\n"); 117 | 118 | printf("\n\n\t\t\tPlayer 1 [ X ] & Player 2 [ 0 ]\n\n\n\n\n"); 119 | 120 | printf("\t\t | | \n"); 121 | printf("\t\t %c | %c | %c \n", square[1], square[2], square[3]); 122 | printf("\t\t _____|_____|_____\n"); 123 | printf("\t\t | | \n"); 124 | 125 | printf("\t\t %c | %c | %c \n", square[4], square[5], square[6]); 126 | 127 | printf("\t\t ____|_____|_____\n"); 128 | printf("\t\t | | \n"); 129 | 130 | printf("\t\t %c | %c | %c \n", square[7], square[8], square[9]); 131 | 132 | printf("\t\t | | \n\n"); 133 | } 134 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![](http://ForTheBadge.com/images/badges/made-with-c.svg) 2 | ![](https://forthebadge.com/images/badges/built-by-developers.svg)
3 | ![Size](https://img.shields.io/github/repo-size/Iamtripathisatyam/C_Programming_Mini_Projects?color=red&label=Repo%20Size%20) 4 | ![License](https://img.shields.io/badge/License-MIT-red.svg) 5 | [![Prettier](https://img.shields.io/badge/Code%20Style-Prettier-red.svg)](https://github.com/prettier/prettier) 6 | ![](https://img.shields.io/tokei/lines/github/Iamtripathisatyam/C_Programming_Mini_Projects?color=red&label=Lines%20of%20Code)
7 | ![](https://profile-counter.glitch.me/{C_Programming_Mini_Projects}/count.svg) 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 | 84 |

85 | 86 |

87 | 88 | ___________________________ 89 | 90 |

91 | 92 |

93 | 94 |

95 | 96 | ___________________________ 97 | 98 |

99 | 100 |

101 | 102 |

103 | 104 | ___________________________________ 105 | 106 |

© 2021 Satyam Tripathi

107 | --------------------------------------------------------------------------------