├── README.md ├── 13recursive.c ├── passByPointer.c ├── 12FileInputOutput.c ├── cStringFun.c ├── 6StructurePointer.c ├── ArrayAndPointerArithmetic.c ├── 11LargestElement.c ├── passByReference.c ├── 1-parrten.c ├── 7EmployeeProgram.c ├── 14BinarySearch.c ├── 10Alphabets.c ├── LICENSE ├── 5Structure.c ├── CharArrayHandling.c └── NCCBank.cpp /README.md: -------------------------------------------------------------------------------- 1 | # Full-Scholarship-Batch2-Age-Unlimit 2 | Scholarship ကျောင်းသားများတွက် သင်ကြားသော code များကို တင်ပေးထားခြင်း ဖြစ်သည်။ 3 | -------------------------------------------------------------------------------- /13recursive.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by National Cyber City on 9/13/2022. 3 | // 4 | 5 | #include 6 | 7 | int sum(int k); 8 | 9 | int main() { 10 | int result = sum(10); 11 | printf("%d", result); 12 | return 0; 13 | } 14 | 15 | int sum(int k) { 16 | if (k > 0) { 17 | return k + sum(k - 1); 18 | } else { 19 | return 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /passByPointer.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by National Cyber City on 8/30/2022. 3 | // 4 | // pointer store address of another variable 5 | 6 | #include "stdio.h" 7 | void doSomething(int* ptr); 8 | int main(){ 9 | 10 | 11 | int data=10; 12 | int* ptr; 13 | 14 | ptr = &data ; 15 | 16 | doSomething(ptr); 17 | 18 | printf(" value of ptr %d ",*ptr); 19 | 20 | return 0; 21 | } 22 | 23 | void doSomething(int* ptr){ 24 | 25 | (*ptr)++; 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /12FileInputOutput.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by National Cyber City on 9/12/2022. 3 | // 4 | 5 | 6 | #include "stdio.h" 7 | #include "stdlib.h" 8 | 9 | int main(){ 10 | char string[1000]; 11 | FILE *fptr; 12 | 13 | fptr = fopen("fullScholar.txt","a"); 14 | 15 | if(fptr == NULL){ 16 | printf("File opening error"); 17 | exit(0); 18 | 19 | } 20 | 21 | printf("Enter some string:"); 22 | fgets(string , sizeof(string) , stdin ); 23 | 24 | fprintf(fptr , "%s" , string); 25 | fclose(fptr); 26 | 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /cStringFun.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by National Cyber City on 8/30/2022. 3 | // 4 | // pointer store address of another variable 5 | 6 | #include "stdio.h" 7 | #include "string.h" 8 | 9 | int main(){ 10 | 11 | 12 | char myarr[10]={'N','C','C'}; 13 | 14 | char myarr2[10]= {'G','E','n','i','u','s'}; 15 | 16 | char myString[100]; 17 | strcpy(myString,myarr); 18 | strcpy(myString,myarr2); 19 | 20 | printf("Data: %s\n",myString); 21 | 22 | strcat(myarr,myarr2); 23 | 24 | printf("Data: %s",myarr); 25 | printf(" length Data: %d", strlen(myarr)); 26 | 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /6StructurePointer.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by National Cyber City on 9/6/2022. 3 | //Structure Pointer 4 | // Win Htut 5 | // 6 | 7 | #include "stdio.h" 8 | #include "stdlib.h" 9 | 10 | 11 | struct MovieInfo{ 12 | 13 | char *name; 14 | char *director; 15 | int age; 16 | 17 | }; 18 | 19 | 20 | int main(){ 21 | 22 | struct MovieInfo *WinHtut; 23 | 24 | WinHtut =(struct MovieInfo*)malloc(sizeof(struct MovieInfo)); 25 | 26 | WinHtut->name="WinHtut"; 27 | WinHtut->director="NationalCyberCity"; 28 | 29 | 30 | printf("Movie Name:%s\n",WinHtut->name); 31 | printf("Movie Director:%s",WinHtut->director); 32 | 33 | return 0; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /ArrayAndPointerArithmetic.c: -------------------------------------------------------------------------------- 1 | // ConsoleApplication1.cpp : This file contains the 'main' function. Program execution begins and ends there. 2 | // 3 | 4 | // size * data = 4*3 = 12 5 | 6 | #include 7 | 8 | int main() 9 | { 10 | 11 | int x[10] = { 1, 50, 3, 10, 20 , 30 , 40 }; 12 | int* ptr; 13 | 14 | char a='a'; 15 | ptr = &x[2]; 16 | 17 | printf("Address of Pointer %d\n",ptr); 18 | 19 | printf("value of Pointer %d\n",*ptr); 20 | 21 | 22 | printf("*(ptr+1) = %d \n", *(ptr + 1)); 23 | 24 | 25 | printf("*(ptr+2)value = %d \n", *(ptr + 3)); 26 | 27 | printf("*(ptr+2)address = %d \n", ptr + a); 28 | 29 | return 0; 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /11LargestElement.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by National Cyber City on 9/12/2022. 3 | // For FullScholar 4 | // 5 | 6 | #include "stdio.h" 7 | #define SIZE 100 8 | 9 | 10 | int main(){ 11 | 12 | int number ; 13 | int data[SIZE]={ 10 , 20, 30, 50,400,100,200,300,5}; 14 | int lossData = data[0]; 15 | 16 | for(int j=1 ; j < SIZE ; j++){ 17 | 18 | if( data[0] < data[j]){ 19 | data[0] = data[j]; 20 | } 21 | } 22 | printf(" Largest Elements of array : %d",data[0]); 23 | 24 | data[0]=lossData; 25 | 26 | printf("\n\nAll elements from array: "); 27 | for ( int k = 0 ; k 4 | 5 | int main() { 6 | 7 | int i=0; 8 | int j=10; 9 | int x=10; 10 | int y=0; 11 | 12 | for ( i=0 ; i:"); 22 | 23 | unsigned int account; 24 | int age; 25 | char name[30]; 26 | double balance; 27 | 28 | scanf("%d%d%20s%lf",&account , &age , name , &balance); 29 | 30 | while (!feof(stdin)){ 31 | fprintf(fptr , "%d%d%20s%lf",account ,age , name , balance); 32 | printf(">:"); 33 | scanf("%d%d%20s%lf",&account , &age , name , &balance); 34 | 35 | } 36 | 37 | fclose(fptr); 38 | 39 | return 0; 40 | 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /14BinarySearch.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by National Cyber City on 9/13/2022. 3 | // Searching Binary Search 4 | // 5 | 6 | #include "stdio.h" 7 | 8 | int binarySearch(int arrayData[] , int toFind , int low , int high ){ // return 1 or -1 (not found ) 9 | 10 | while (low <= high){ 11 | int mid = low + ( high-low)/2 ; 12 | 13 | if( arrayData[mid] == toFind) 14 | return mid; 15 | if( arrayData[mid] < toFind) 16 | low = mid + 1 ; 17 | else 18 | high = mid - 1 ; 19 | } 20 | return -1; 21 | } 22 | int main(){ 23 | int toFind=0; 24 | int data[] = {1,5,6,7,8,10,20,30,40 , 100 , 200 , 300}; 25 | printf(" Enter data to find:"); 26 | scanf("%d",&toFind); 27 | int size =sizeof (data) / sizeof (data[0]); 28 | int result = binarySearch(data ,toFind , 0 ,size-1 ); 29 | if (result == -1){ 30 | 31 | printf("Data not found "); 32 | } else{ 33 | printf("Data found!"); 34 | 35 | } 36 | return 0; 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /10Alphabets.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by National Cyber City on 9/12/2022. 3 | // 4 | 5 | #include 6 | int main() { 7 | char line[150]; 8 | 9 | 10 | printf("Enter a string: "); 11 | fgets(line, sizeof(line), stdin); // take input 12 | 13 | 14 | for (int i = 0, j; line[i] != '\0'; ++i) { 15 | 16 | // enter the loop if the character is not an alphabet 17 | // and not the null character 18 | while (!(line[i] >= 'a' && line[i] <= 'z') &&!(line[i] >= 'A' && line[i] <= 'Z') && !(line[i] == '\0')) { 19 | for (j = i; line[j] != '\0'; ++j) { 20 | 21 | // if jth element of line is not an alphabet, 22 | // assign the value of (j+1)th element to the jth element 23 | 24 | line[j] = line[j + 1]; 25 | } 26 | line[j] = '\0'; 27 | } 28 | } 29 | printf("Output String: "); 30 | puts(line); 31 | return 0; 32 | } 33 | 34 | // bc100cb 35 | //asdklfja;skldfj;klasjdf;kljas;ldfjk;lasjd;fjasd;fkjas;ldfaksdfja;sdfja;sfksa;d 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 WinHtut 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 | -------------------------------------------------------------------------------- /5Structure.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by National Cyber City on 9/6/2022. 3 | // 4 | 5 | // 6 | // Created by National Cyber City on 9/6/2022. 7 | //structure struct 8 | // 9 | 10 | #include "stdio.h" 11 | #include "string.h" 12 | void getNames(struct Human_data *hd); 13 | struct Human_data{ 14 | 15 | char name[20]; 16 | char fname[20]; 17 | char hobby[20]; 18 | int age=0; 19 | 20 | }; 21 | 22 | int main(){ 23 | struct Human_data Name1; 24 | struct Human_data Name2; 25 | struct Human_data Name3; 26 | 27 | strcpy(Name1.name , "Win Htut"); 28 | strcpy(Name1.fname , "fffWinHtut"); 29 | strcpy(Name1.hobby , "Research"); 30 | Name1.age=111; 31 | 32 | strcpy(Name2.name , "Shin"); 33 | strcpy(Name2.fname , "xxxxxxxx"); 34 | strcpy(Name2.hobby , "@@@@@@@@@"); 35 | Name2.age=101; 36 | 37 | strcpy(Name3.name , "ShinYell"); 38 | strcpy(Name3.fname , "shinyell"); 39 | strcpy(Name3.hobby , "testing"); 40 | Name2.age=101; 41 | 42 | 43 | getNames(&Name1); 44 | getNames(&Name2); 45 | getNames(&Name3); 46 | 47 | return 0; 48 | 49 | } 50 | 51 | void getNames(struct Human_data *hd){ 52 | printf("Name:%s\n",hd->name); 53 | printf("Father Name:%s\n",hd->fname); 54 | printf("Hobby :%s\n",hd->hobby); 55 | printf("Age :%d\n",hd->age); 56 | } 57 | 58 | 59 | -------------------------------------------------------------------------------- /CharArrayHandling.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by National Cyber City on 8/30/2022. 3 | // 4 | // pointer store address of another variable 5 | 6 | #include "stdio.h" 7 | #include "string.h" 8 | 9 | int main(){ 10 | int index=0; 11 | 12 | char myarr[10]={'N','C','C','\0'}; 13 | 14 | char myarr2[10]= {'G','E','n','i','u','s','\0'}; 15 | 16 | char myarr3[10]={'H','E','L','L','o','\0'}; 17 | 18 | char totalArary[100]; 19 | 20 | for(int i =0 ; myarr[i] != '\0' ; i++){ 21 | 22 | totalArary[i] = myarr[i]; 23 | index = index + i; 24 | 25 | } 26 | 27 | printf(" myarr data: %s\n",totalArary); 28 | printf(" Index number: %d\n",index); 29 | 30 | 31 | for(int i =0 ; myarr2[i] != '\0' ; i++){ 32 | 33 | totalArary[index] = myarr2[i]; 34 | index++; 35 | 36 | 37 | } 38 | printf(" myarr data: %s\n",totalArary); 39 | printf(" Last Index number: %d\n",index); 40 | 41 | for(int i =0 ; myarr3[i] != '\0' ; i++){ 42 | 43 | totalArary[index] = myarr3[i]; 44 | index++; 45 | } 46 | printf(" @myarr data: %s\n",totalArary); 47 | printf(" @Last Index number: %d\n",index); 48 | 49 | 50 | for(int x=0 ; x>name; 42 | cout<<"Enter your password to register:"; 43 | cin>>password; 44 | cout<<"Confirm password to register:"; 45 | cin>>password2; 46 | cout<<"Enter amount:"; 47 | cin>>money; 48 | if(password == password2){ 49 | 50 | username[locate] = name ; 51 | upassword[locate] = password; 52 | amount[locate] = money; 53 | 54 | 55 | cout<<"Registration Success!"<>lusername; 67 | cout<<"Enter pass to login for"<>lpassword; 69 | 70 | for(int i=0; i<=locate ; i++){ 71 | if(lusername == username[i] && lpassword== upassword[i]){ 72 | currentID = i; 73 | currentUserAmount = amount[i]; 74 | cout<<"Login Success"<>exchangeOption; 94 | if(exchangeOption==1){ 95 | cout<<"Enter name to transfer:"; 96 | cin>>toTransferName; 97 | int receiverID = toCheckUserName(toTransferName); 98 | 99 | if(receiverID){ 100 | while (receiverID){ 101 | 102 | cout<<"Enter amount to Transfer:"; 103 | cin>>toTransferAmount; 104 | if(toTransferAmount>=currentUserAmount){ 105 | cout<<"Invalid amount:"<>withdrawamount; 126 | 127 | if(amount[currentID]-100 > withdrawamount){ 128 | toWithDraw(currentID , withdrawamount); 129 | exchange(); 130 | } else{ 131 | cout<<"Invalid amount to withdraw : "<>toupdateAmount; 140 | updateAmount(toupdateAmount); 141 | allInfo(); 142 | exchange(); 143 | 144 | } else if(exchangeOption==4){ 145 | //Quit Option 146 | login(); 147 | 148 | }else{ 149 | cout<<"Invalid Option"<>option; 188 | if(option == 1){ 189 | //registration 190 | reGister(); 191 | } else if(option == 2){ 192 | //login 193 | int status=login(); 194 | if(status == 100){ 195 | cout<<"Try again"<