├── .gitignore ├── Array ├── 2D Array take input.c ├── 2D Array.c ├── Array Count number (positive or negetive).c ├── Check The position maximum and minimum number position.c ├── Diagonal Matrix.c ├── Matrix Multiplication.c ├── Matrix Tranpose.c ├── Matrix with array.c ├── array to array.c ├── fibonnaki number.c ├── find the number ( Bid & middle and small ).c ├── linear search.c ├── matrix user input.c ├── maximun & minimum.c ├── maximun.c ├── minimun.c └── sum and average.c ├── Function ├── 208 Factorial Using Recursion.c ├── Passing Array to function.c ├── Passing String to function.c ├── Square of a number.c ├── X To The Power Y using User-defined Function.c ├── finding maximum value from an array using function.c ├── function 1.c ├── function 2.c ├── function 3.c └── x to the power y Library function.c ├── LinkList.c ├── Pattern ├── 145.c ├── 149.c ├── 153.c ├── 153.exe ├── 153.o ├── 154.c ├── 154.exe ├── 154.o ├── 155.c ├── 155.exe ├── 155.o ├── 2.c ├── 2.exe ├── 2.o ├── 3.c ├── 3.exe ├── 3.o ├── 4.c ├── 4.exe ├── 4.o ├── 5.c ├── 5.exe ├── 5.o ├── 6.c ├── 6.exe ├── 6.o ├── 7.c ├── 7.exe ├── 7.o ├── Untitled1.c └── type2 │ ├── 1.c │ ├── 1.o │ ├── 2.c │ ├── 3.c │ └── 3.o ├── Pointer ├── Access array elements using pointer.c ├── Access array elements using pointer.exe ├── Access array elements using pointer.o ├── Adding two numbers using pointer.c ├── Adding two numbers using pointer.exe ├── Adding two numbers using pointer.o ├── ntroduction to pointer.c ├── ntroduction to pointer.exe ├── ntroduction to pointer.o ├── pointer pointing to different variable.c ├── pointer pointing to different variable.exe ├── pointer pointing to different variable.o ├── swapping two numbers using pointer and function.c ├── swapping two numbers using pointer and function.exe ├── swapping two numbers using pointer and function.o ├── swapping two numbers.c ├── swapping two numbers.exe └── swapping two numbers.o ├── README.md ├── Recurtion ├── Direct recursion.c ├── fibonakki.c ├── recartion factorial.c ├── recartion.c ├── reverse number.c └── sum of natural number.c ├── Structure ├── Array of structure.c ├── Array of structure.exe ├── Array of structure.o ├── Array within structure.c ├── Array within structure.exe ├── Array within structure.o ├── Input structure element.c ├── Input structure element.exe ├── Input structure element.o ├── Introduction to typedef.c ├── Introduction to union.c ├── Introduction to union.exe ├── Introduction to union.o ├── initialize structure variables.c ├── initialize structure variables.exe ├── initialize structure variables.o ├── local ,global.c ├── local ,global.exe ├── local ,global.o ├── passing structure variable to function.c ├── passing structure variable to function.exe ├── passing structure variable to function.o ├── recartion.exe ├── recartion.o ├── size of union and structure.c ├── size of union and structure.exe ├── size of union and structure.o ├── structure comparison.c ├── structure comparison.exe └── structure comparison.o └── loop ├── 10.c ├── 10.exe ├── 10.o ├── G.C.D & L.C.M.c ├── G.C.D & L.C.M.o ├── Series 3.c ├── Series 3.exe ├── Series 3.o ├── Untitled3.exe ├── Untitled3.o ├── armstrong number.c ├── armstrong number.exe ├── armstrong number.o ├── calculator.c ├── calculator.exe ├── calculator.o ├── count digit.c ├── count digit.exe ├── count digit.o ├── critical while.c ├── do while loop.c ├── do while loop.exe ├── do while loop.o ├── factoriaal.c ├── fibonakki.c ├── fibonakki.exe ├── fibonakki.o ├── for loop.c ├── for loop.exe ├── for loop.o ├── number series using for.c ├── number series using for.exe ├── number series using for.o ├── number show.c ├── number show.exe ├── number show.o ├── positive number sum'.c ├── positive number sum'.exe ├── positive number sum'.o ├── practice.c ├── practice.exe ├── practice.o ├── reverse number.c ├── reverse number.exe ├── reverse number.o ├── series ...c ├── series 1.c ├── series 1.exe ├── series 1.o ├── series 2.c ├── series 2.exe ├── series 2.o ├── series Hard.c ├── series multiple.c ├── series multiple.exe ├── series multiple.o ├── series power.c ├── series power.exe ├── series power.o ├── special formate outup show.c ├── special formate outup show.exe ├── special formate outup show.o ├── sum 1.exe ├── sum 1.o ├── sum of digit.c ├── sum of digit.exe ├── sum of digit.o ├── sum series.c ├── sum series.exe ├── sum series.o ├── sum.c ├── sum.exe ├── sum.o └── value.c /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Object files 5 | *.o 6 | *.ko 7 | *.obj 8 | *.elf 9 | 10 | # Linker output 11 | *.ilk 12 | *.map 13 | *.exp 14 | 15 | # Precompiled Headers 16 | *.gch 17 | *.pch 18 | 19 | # Libraries 20 | *.lib 21 | *.a 22 | *.la 23 | *.lo 24 | 25 | # Shared objects (inc. Windows DLLs) 26 | *.dll 27 | *.so 28 | *.so.* 29 | *.dylib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | *.i*86 36 | *.x86_64 37 | *.hex 38 | 39 | # Debug files 40 | *.dSYM/ 41 | *.su 42 | *.idb 43 | *.pdb 44 | 45 | # Kernel Module Compile Results 46 | *.mod* 47 | *.cmd 48 | .tmp_versions/ 49 | modules.order 50 | Module.symvers 51 | Mkfile.old 52 | dkms.conf 53 | -------------------------------------------------------------------------------- /Array/2D Array take input.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int r,c; 5 | int A[3][3]; 6 | printf("~~~ Enter 2D Array Number ~~~\n\n"); 7 | for(r=0; r<3; r++) 8 | { 9 | for(c=0; c<3; c++) 10 | { 11 | printf("Enter value = "); 12 | scanf("%d",&A[r][c]); 13 | } 14 | printf("\n"); 15 | } 16 | 17 | // Print Value 18 | 19 | printf("Value =\n"); 20 | for(r=0; r<3; r++) 21 | { 22 | for(c=0; c<3; c++) 23 | { 24 | printf("\t%d",A[r][c]); 25 | } 26 | printf("\n"); 27 | } 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /Array/2D Array.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int A[3][4]={{10,20,30,40},{11,22,33,44},{12,34,56,78}}; 5 | int row,col; 6 | for(row=0;row<3;row++) 7 | { 8 | for(col=0;col<4;col++) 9 | { 10 | printf("%d ",A[row][col]); 11 | } 12 | printf("\n"); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Array/Array Count number (positive or negetive).c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n,i; 5 | int Positive_num=0, Negative_num=0; 6 | printf( "Please Enter the value of N (Array size):"); 7 | scanf("%d",&n); 8 | int num[n]; 9 | printf("Please Enter the Array Elements:\n"); 10 | 11 | for(i=0;i= 0) 19 | { 20 | Positive_num++; 21 | } 22 | else 23 | { 24 | Negative_num++; 25 | } 26 | 27 | } 28 | printf("Total positive number=%d\n",Positive_num); 29 | printf("Total positive number=%d\n",Negative_num); 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /Array/Check The position maximum and minimum number position.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n,i,minimum,min_position,maximum,max_position; 5 | printf("Input the length of the array: "); 6 | scanf("%d", &n); 7 | // Array Size 8 | int num[n]; 9 | printf("\nInput the array elements (Different type): "); 10 | for(i = 0; i < n; i++) 11 | { 12 | scanf("%d",&num[i]); 13 | } 14 | // Default position and minimum value initialization 15 | minimum = num[0]; 16 | min_position = 0; 17 | for(i = 0; i < n; i++) 18 | { 19 | if(minimum > num[i]) 20 | { 21 | minimum = num[i]; 22 | min_position = i; 23 | } 24 | } 25 | printf("Maximum Value: %d\n", minimum); 26 | printf("Position of the element: %d\n\n", min_position+1); 27 | // Default position and maximum value initialization 28 | maximum = num[0]; 29 | max_position = 0; 30 | 31 | for(i = 0; i < n; i++) 32 | { 33 | if(maximum < num[i]) 34 | { 35 | maximum = num[i]; 36 | max_position = i; 37 | } 38 | } 39 | printf("Maximum Value: %d\n", maximum); 40 | printf("Position of the element: %d\n", max_position+1); 41 | 42 | return 0; 43 | } 44 | 45 | -------------------------------------------------------------------------------- /Array/Diagonal Matrix.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | printf("Enter Matrix Value\n"); 5 | int A[3][3],i,j; 6 | int sum=0; 7 | 8 | for(i=0; i<3; i++) 9 | { 10 | for(j=0; j<3; j++) 11 | { 12 | printf("A[%d][%d]=",i,j); 13 | scanf("%d",&A[i][j]); 14 | } 15 | printf("\n"); 16 | } 17 | printf("A="); 18 | for(i=0; i<3; i++) 19 | { 20 | printf("\t"); 21 | for(j=0; j<3; j++) 22 | { 23 | printf("%d ",A[i][j]); 24 | } 25 | printf("\n"); 26 | } 27 | // addition diagonal number 28 | 29 | for(i=0; i<3; i++) 30 | { 31 | for(j=0; j<3; j++) 32 | { 33 | if(i==j) 34 | sum=sum+A[i][j]; 35 | } 36 | 37 | } 38 | for(i=0; i<3; i++) 39 | { 40 | for(j=0; j<3; j++) 41 | { 42 | if(i==j) 43 | for(i=0; i<3; i++) 44 | { 45 | for(j=0; j<3; j++) 46 | { 47 | if(i==j) 48 | printf("Diagonal Matrix =%d\n",A[i][j]); 49 | } 50 | 51 | } 52 | } 53 | 54 | } 55 | 56 | printf("Sum of Diagonal Of matrix=%d",sum); 57 | 58 | return 0; 59 | } 60 | -------------------------------------------------------------------------------- /Array/Matrix Multiplication.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int first[10][10],second [10][10],result[10][10],c1,c2,r1,r2,i,j; 5 | printf("Enter first matrix row and column:"); 6 | scanf("%d %d",&c1,&r1); 7 | printf("Enter second matrix row and column:"); 8 | scanf("%d %d",&c2,&r2); 9 | while(c1!=r2) 10 | { 11 | printf("Error \n"); 12 | printf("Enter first matrix row and column:"); 13 | scanf("%d %d",&c1,&r1); 14 | printf("Enter second matrix row and column:"); 15 | scanf("%d %d",&c1,&r1); 16 | 17 | } 18 | // first matrix value take 19 | printf("**First matrix value take**\n"); 20 | for(i=0;i 2 | int main() 3 | { 4 | int row,column,i,j; 5 | int A[10][10],trans[10][10]; 6 | printf("Enter row and column number="); 7 | scanf("%d %d",&row,&column); 8 | for(i=0; i 2 | int main() 3 | { 4 | int r,c; 5 | int A[3][4]; 6 | printf("Enter 12 Number\n"); 7 | for(r=0; r<3; r++) 8 | { 9 | for(c=0; c<4; c++) 10 | { 11 | printf("A[%d][%d]=",r,c); 12 | scanf("%d",&A[r][c]); 13 | } 14 | printf("\n"); 15 | } 16 | printf("A="); 17 | for(r=0; r<3; r++) 18 | { 19 | printf("\t"); 20 | for(c=0; c<4; c++) 21 | { 22 | printf("%d ",A[r][c]); 23 | } 24 | printf("\n"); 25 | } 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /Array/array to array.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int array1[5]={10,20,30,40,50},array2[5],i; 5 | printf("Array1="); 6 | for(i=0;i<5;i++) 7 | { 8 | printf(" %d ",array1[i]); 9 | } 10 | // coping all the elements 11 | for(i=0;i<5;i++) 12 | { 13 | array2[i]=array1[i]; 14 | } 15 | printf("\nArray2:"); 16 | for(i=0;i<5;i++) 17 | { 18 | printf(" %d ",array2[i]); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Array/fibonnaki number.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n,a[30],i; 5 | printf("How many fibonnakki number:"); 6 | scanf("%d",&n); 7 | a[0]=0; 8 | a[1]=1; 9 | for(i=2;i 2 | int main() 3 | { 4 | int n,i; 5 | // int array[]= {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; 6 | printf("Enter how many number you want to Binary search?\n="); 7 | scanf("%d",&n); 8 | int array[n]; 9 | for(i=0;i high_index) 33 | { 34 | printf(" %d not in array \n",num); 35 | } 36 | else 37 | { 38 | printf("%d is found in the array . it is the %d th element of array.\n ",array[mid_index],mid_index+1); 39 | } 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /Array/linear search.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int num[1000],n,i,value; 5 | // Enter the array size 6 | printf("How many number you want="); 7 | scanf("%d",&n); 8 | // Enter array element 9 | printf("\n"); 10 | printf("Enter %d number=",n); 11 | for(i=0; i 2 | int main() 3 | { 4 | int r,c,numberOFrows,numberOFcolumn; 5 | int A[10][10],B[10][10],C[10][10]; 6 | printf("Enter the number of rows and column="); 7 | scanf("%d %d",&numberOFrows,&numberOFcolumn); 8 | //take input A matrix// 9 | printf("Enter elements for A matrix\n"); 10 | for(r=0; r 2 | int main() 3 | { 4 | int num[100],n,i; 5 | printf("How many number you want?\n="); 6 | scanf("%d",&n); 7 | printf("Enter %d Numbers=",n); 8 | for(i=0;inum[i]) 26 | min=num[i]; 27 | } 28 | printf("Minimum Number =%d\n",min); 29 | int sum=max+min; 30 | printf("Sum Of maximum and minimum number=%d ",sum); 31 | return 0; 32 | } 33 | 34 | -------------------------------------------------------------------------------- /Array/maximun.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int num[100],n,i; 5 | printf("How many number you want?"); 6 | scanf("%d",&n); 7 | for(i=0;i 2 | int main() 3 | { 4 | int num[100],n,i; 5 | printf("How many number you want?"); 6 | scanf("%d",&n); 7 | for(i=0;inum[i]) 16 | min=num[i]; 17 | } 18 | printf("Minimum Number =%d",min); 19 | 20 | } 21 | 22 | -------------------------------------------------------------------------------- /Array/sum and average.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int a[100],i,sum=0,n; 5 | printf("Enter How many number you want?\n="); 6 | scanf("%d",&n); 7 | printf("Enter number="); 8 | for(i=0;i 2 | int main() 3 | { 4 | int i,result; 5 | 6 | printf("Enter a Number="); 7 | scanf("%d",&i); 8 | 9 | result=fact(i); 10 | 11 | printf("Factorial of %d is=%d",i,result); 12 | getch(); 13 | } 14 | 15 | int fact (int n) 16 | { 17 | if(n==1) 18 | { 19 | return 1; 20 | } 21 | else 22 | return n*fact(n-1); 23 | } 24 | -------------------------------------------------------------------------------- /Function/Passing Array to function.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int num[]={50,80,90,60,70}; 5 | 6 | show(num); 7 | } 8 | void show(int num[]) 9 | { 10 | int i; 11 | for(i=0;i<5;i++) 12 | { 13 | printf("%d\n",num[i]); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Function/Passing String to function.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | char s1[]="S. M. SAJJAD HOSSAIN JIM"; 5 | 6 | display(s1); 7 | 8 | } 9 | 10 | void display(char s2[]) 11 | 12 | { 13 | int i=0; 14 | while(s2[i]!='\0') 15 | { 16 | printf("%c",s2[i]); 17 | i++; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Function/Square of a number.c: -------------------------------------------------------------------------------- 1 | #include 2 | double triangle(double a, double b); 3 | int main() 4 | { 5 | double base, height,area; 6 | printf("Enter the base="); 7 | scanf("%lf",&base); 8 | 9 | 10 | printf("Enter the height="); 11 | scanf("%lf",&height); 12 | area = triangle(base,height); 13 | 14 | printf("The area of tr-Angle=%.2lf",area); 15 | 16 | } 17 | double triangle(double a, double b) 18 | { 19 | return 0.5* a * b; 20 | } 21 | -------------------------------------------------------------------------------- /Function/X To The Power Y using User-defined Function.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | double base, exp; 5 | printf("Enter base="); 6 | scanf("%lf",&base); 7 | printf("Enter Exponent="); 8 | scanf("%lf",&exp); 9 | calculate_power(base,exp); 10 | 11 | } 12 | void calculate_power(double base, double exp) 13 | { 14 | double result=1,i; 15 | printf("Result\n"); 16 | for(i=1; i 2 | int main() 3 | { 4 | int num[]={50,80,90,60,70}; 5 | 6 | int maximumvalue= maximum(num); 7 | 8 | printf("Maximum value=%d",maximumvalue); 9 | 10 | } 11 | int maximum(int num[]) 12 | { 13 | int i; 14 | int max=num[0]; 15 | for(i=1;i<5;i++) 16 | { 17 | if(max 2 | int main() 3 | { 4 | int num1,num2; 5 | 6 | printf("Enter two number= "); 7 | 8 | scanf("%d %d",&num1,&num2); 9 | 10 | printf("The sum is=%d \n",sum(num1,num2)); 11 | } 12 | 13 | // Return_type Function_name [Argument] // 14 | 15 | int sum(int a,int b) 16 | { 17 | return a+b ; 18 | } 19 | -------------------------------------------------------------------------------- /Function/function 2.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int num1,num2; 5 | 6 | printf("Enter two number= "); 7 | 8 | scanf("%d %d",&num1,&num2); 9 | 10 | int result= sum(num1,num2); 11 | 12 | printf("The sum is=%d \n",result); 13 | } 14 | 15 | 16 | int sum(int a,int b) 17 | { 18 | return a+b ; 19 | } 20 | -------------------------------------------------------------------------------- /Function/function 3.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | 5 | sum(5,6); 6 | 7 | sub(10,3); 8 | 9 | } 10 | void sum(int a,int b) 11 | { 12 | printf("The subtraction is=%d\n",a+b); 13 | } 14 | 15 | void sub(int a,int b) 16 | { 17 | printf("The sum is=%d\n",a-b); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Function/x to the power y Library function.c: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /LinkList.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct student 4 | 5 | { 6 | int data; 7 | struct node *next; 8 | } a,b,c,d; 9 | 10 | int main() 11 | { 12 | a.data=10; 13 | b.data=20; 14 | c.data = 30; 15 | d.data = 40; 16 | 17 | a.next = &b; 18 | b.next = &c; 19 | c.next = &d; 20 | d.next = NULL; 21 | 22 | printf("A Data =%d \n",a.data); 23 | printf("B Data =%d \n",b.data); 24 | printf("C Data =%d \n",c.data); 25 | printf("D Data =%d \n\n",d.data); 26 | 27 | printf("lOCATION OF A address =%x \n",a.next); 28 | printf("lOCATION OF B address =%x \n",b.next); 29 | printf("lOCATION OF C address =%x \n",c.next); 30 | printf("lOCATION OF D address =%x \n",d.next); 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /Pattern/145.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n,row,column; 5 | printf("Enter value N="); 6 | scanf("%d",&n); 7 | for(row=1;row<=n;row++) 8 | { 9 | for(column=1; column<=row; column++) 10 | { 11 | printf("%d ",row); //printf("%c",row+64) 12 | } 13 | printf("\n"); 14 | } 15 | 16 | for(row=n-1;row>=1;row--) 17 | { 18 | for(column=1; column<=row; column++) 19 | { 20 | printf("%d ",row); //printf("%c",row+64) 21 | } 22 | printf("\n"); 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Pattern/149.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n,row,column; 5 | printf("Enter value N="); 6 | scanf("%d",&n); 7 | for(row=n; row>=1; row--) 8 | { 9 | for(column=1; column<=n-row; column++) 10 | { 11 | printf(" "); 12 | } 13 | for(column=1;column<=row;column++) 14 | { 15 | printf("%d",column); // printf("%c",column+64); 16 | } 17 | printf("\n"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Pattern/153.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n,row,column; 5 | printf("Enter the number of N="); 6 | scanf("%d",&n); 7 | for(row=1;row<=n;row++) 8 | { 9 | // space print 10 | for(column=1;column<=n-row;column++) 11 | { 12 | printf(" "); 13 | } 14 | for(column=1;column<=2*row-1;column++) 15 | { 16 | printf("%d",column); 17 | 18 | } 19 | printf("\n"); 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /Pattern/153.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pattern/153.exe -------------------------------------------------------------------------------- /Pattern/153.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pattern/153.o -------------------------------------------------------------------------------- /Pattern/154.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n,row,column; 5 | printf("Enter the number of N="); 6 | scanf("%d",&n); 7 | for(row=n;row>=1;row--) 8 | { 9 | // space print 10 | for(column=1;column<=n-row;column++) 11 | { 12 | printf(" "); 13 | } 14 | for(column=1;column<=2*row-1;column++) 15 | { 16 | printf(" %d ",column); 17 | 18 | } 19 | printf("\n"); 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /Pattern/154.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pattern/154.exe -------------------------------------------------------------------------------- /Pattern/154.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pattern/154.o -------------------------------------------------------------------------------- /Pattern/155.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n,row,column; 5 | printf("Enter the number of N="); 6 | scanf("%d",&n); 7 | for(row=1;row<=n;row++) 8 | { 9 | // space print 10 | for(column=1;column<=n-row;column++) 11 | { 12 | printf(" "); 13 | } 14 | for(column=1;column<=2*row-1;column++) 15 | { 16 | printf("%d",column); 17 | 18 | } 19 | printf("\n"); 20 | } 21 | for(row=n-1;row>=1;row--) 22 | { 23 | // space print 24 | for(column=1;column<=n-row;column++) 25 | { 26 | printf(" "); 27 | } 28 | for(column=1;column<=2*row-1;column++) 29 | { 30 | printf("%d",column); 31 | 32 | } 33 | printf("\n"); 34 | } 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /Pattern/155.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pattern/155.exe -------------------------------------------------------------------------------- /Pattern/155.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pattern/155.o -------------------------------------------------------------------------------- /Pattern/2.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n,row,column; 5 | printf("Enter N="); 6 | scanf("%d",&n); 7 | for(row=1; row<=n; row++) 8 | { 9 | for(column=1; column<=row; column++) 10 | { 11 | printf("%d ",row); 12 | } 13 | printf("\n"); 14 | } 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /Pattern/2.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pattern/2.exe -------------------------------------------------------------------------------- /Pattern/2.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pattern/2.o -------------------------------------------------------------------------------- /Pattern/3.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n,row,column; 5 | printf("Enter N="); 6 | scanf("%d",&n); 7 | for(row=1; row<=n; row++) 8 | { 9 | for(column=1; column<=row; column++) 10 | { 11 | printf("%d ",column%2); 12 | } 13 | printf("\n"); 14 | } 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /Pattern/3.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pattern/3.exe -------------------------------------------------------------------------------- /Pattern/3.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pattern/3.o -------------------------------------------------------------------------------- /Pattern/4.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n,row,column; 5 | printf("Enter N="); 6 | scanf("%d",&n); 7 | for(row=1; row<=n; row++) 8 | { 9 | for(column=1; column<=row; column++) 10 | { 11 | printf("%d ",row%2); 12 | } 13 | printf("\n"); 14 | } 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /Pattern/4.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pattern/4.exe -------------------------------------------------------------------------------- /Pattern/4.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pattern/4.o -------------------------------------------------------------------------------- /Pattern/5.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n,row,column; 5 | printf("Enter N="); 6 | scanf("%d",&n); 7 | for(row=1; row<=n; row++) 8 | { 9 | for(column=1; column<=row; column++) 10 | { 11 | printf("%c ",column+64); //For small latter (column+96) 12 | } 13 | printf("\n"); 14 | } 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /Pattern/5.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pattern/5.exe -------------------------------------------------------------------------------- /Pattern/5.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pattern/5.o -------------------------------------------------------------------------------- /Pattern/6.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n,row,column; 5 | printf("Enter N="); 6 | scanf("%d",&n); 7 | for(row=1; row<=n; row++) 8 | { 9 | for(column=1; column<=row; column++) 10 | { 11 | printf("%c ",row+64); // small latter (row+96) 12 | } 13 | printf("\n"); 14 | } 15 | return 0; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /Pattern/6.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pattern/6.exe -------------------------------------------------------------------------------- /Pattern/6.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pattern/6.o -------------------------------------------------------------------------------- /Pattern/7.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n,row,column; 5 | printf("Enter N="); 6 | scanf("%d",&n); 7 | for(row=1; row<=n; row++) 8 | { 9 | for(column=1; column<=row; column++) 10 | { 11 | printf("JIM "); 12 | } 13 | printf("\n"); 14 | } 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /Pattern/7.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pattern/7.exe -------------------------------------------------------------------------------- /Pattern/7.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pattern/7.o -------------------------------------------------------------------------------- /Pattern/Untitled1.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n,row,column; 5 | printf("Enter N="); 6 | scanf("%d",&n); 7 | for(row=1; row<=n; row++) 8 | { 9 | for(column=1; column<=row; column++) 10 | { 11 | printf("%d ",column); 12 | } 13 | printf("\n"); 14 | } 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /Pattern/type2/1.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n,row,column; 5 | printf("Enter N="); 6 | scanf("%d",&n); 7 | for(row=n; row>=1; row--) 8 | { 9 | for(column=1; column<=row; column++) 10 | { 11 | printf("%d ",column); 12 | } 13 | printf("\n"); 14 | } 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /Pattern/type2/1.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pattern/type2/1.o -------------------------------------------------------------------------------- /Pattern/type2/2.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n,row,column; 5 | printf("Enter N="); 6 | scanf("%d",&n); 7 | for(row=n; row>=1; row--) 8 | { 9 | for(column=1; column<=row; column++) 10 | { 11 | printf("%d ",row); 12 | } 13 | printf("\n"); 14 | } 15 | return 0; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /Pattern/type2/3.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n,row,column; 5 | printf("Enter N="); 6 | scanf("%d",&n); 7 | for(row=n; row>=1; row--) 8 | { 9 | for(column=1; column<=row; column++) 10 | { 11 | printf("%d ",column%2); 12 | } 13 | printf("\n"); 14 | } 15 | return 0; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /Pattern/type2/3.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pattern/type2/3.o -------------------------------------------------------------------------------- /Pointer/Access array elements using pointer.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int array[5],i; 5 | printf("Enter Five number:"); 6 | 7 | for(i=0;i<5;i++) 8 | { 9 | scanf("%d",&array[i]); // Enter Integer number 10 | } 11 | 12 | int *pointer; 13 | 14 | pointer=&array[0]; 15 | 16 | for(i=0; i<5; i++) 17 | { 18 | printf("Value =%d\n",*pointer); // Use pointer in Loop // 19 | pointer++; 20 | } 21 | getch(); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /Pointer/Access array elements using pointer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pointer/Access array elements using pointer.exe -------------------------------------------------------------------------------- /Pointer/Access array elements using pointer.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pointer/Access array elements using pointer.o -------------------------------------------------------------------------------- /Pointer/Adding two numbers using pointer.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int x=56 ,y=4, sum; 5 | 6 | int *point1=&x,*point2=&y; 7 | 8 | sum= *point1 + *point2; 9 | 10 | printf("SUM of two number=%d",sum); 11 | 12 | getch(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Pointer/Adding two numbers using pointer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pointer/Adding two numbers using pointer.exe -------------------------------------------------------------------------------- /Pointer/Adding two numbers using pointer.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pointer/Adding two numbers using pointer.o -------------------------------------------------------------------------------- /Pointer/ntroduction to pointer.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int x; 5 | 6 | printf("Enter a number="); 7 | scanf("%d",&x); 8 | 9 | int *point; 10 | 11 | point=&x; 12 | 13 | printf("Value of x=%d\n",x); 14 | printf("Address of x=%d\n\n",&x); 15 | 16 | printf("Value of voilder=%d\n",*point); 17 | printf("Address of pointer=%d\n",&point); 18 | } 19 | -------------------------------------------------------------------------------- /Pointer/ntroduction to pointer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pointer/ntroduction to pointer.exe -------------------------------------------------------------------------------- /Pointer/ntroduction to pointer.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pointer/ntroduction to pointer.o -------------------------------------------------------------------------------- /Pointer/pointer pointing to different variable.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int x=23, y=67, z=89; 5 | 6 | int *point; 7 | 8 | point=&x; 9 | printf("X=%d\n",*point); 10 | 11 | point=&y; 12 | printf("Y=%d\n",*point); 13 | 14 | 15 | point=&z; 16 | printf("Z=%d\n",*point); 17 | } 18 | -------------------------------------------------------------------------------- /Pointer/pointer pointing to different variable.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pointer/pointer pointing to different variable.exe -------------------------------------------------------------------------------- /Pointer/pointer pointing to different variable.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pointer/pointer pointing to different variable.o -------------------------------------------------------------------------------- /Pointer/swapping two numbers using pointer and function.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int x=56, y=90; 5 | 6 | // Before swapping 7 | printf("Value of X=%d\n",x); 8 | printf("Value of Y=%d\n",y); 9 | 10 | swap(&x,&y); 11 | 12 | printf("\n"); 13 | // After swapping 14 | printf("Value of X=%d\n",x); 15 | printf("Value of Y=%d\n",y); 16 | 17 | 18 | } 19 | void swap(int *point1, int *point2) 20 | { 21 | int temp; 22 | temp=*point1; 23 | *point1=*point2; 24 | *point2=temp; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /Pointer/swapping two numbers using pointer and function.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pointer/swapping two numbers using pointer and function.exe -------------------------------------------------------------------------------- /Pointer/swapping two numbers using pointer and function.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pointer/swapping two numbers using pointer and function.o -------------------------------------------------------------------------------- /Pointer/swapping two numbers.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int x=56, y=90, temp; 5 | 6 | int *point1=&x, *point2=&y; 7 | 8 | // Before swapping 9 | printf("Value of X=%d\n",*point1); 10 | printf("Value of Y=%d\n",*point2); 11 | 12 | printf("\n"); 13 | 14 | temp=*point1; 15 | *point1=*point2; 16 | *point2=temp; 17 | 18 | // After swapping 19 | printf("Value of X=%d\n",*point1); 20 | printf("Value of Y=%d\n",*point2); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Pointer/swapping two numbers.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pointer/swapping two numbers.exe -------------------------------------------------------------------------------- /Pointer/swapping two numbers.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Pointer/swapping two numbers.o -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Basic C_Programming 2 | -------------------------------------------------------------------------------- /Recurtion/Direct recursion.c: -------------------------------------------------------------------------------- 1 | #include 2 | void odd(); 3 | void even(); 4 | 5 | int main() 6 | { 7 | odd(); 8 | even(); 9 | } 10 | int n=1; 11 | void odd() 12 | { 13 | if(n <= 10) 14 | { 15 | printf("%d ", n+1); 16 | n++; 17 | even(); 18 | } 19 | return; 20 | } 21 | void even() 22 | { 23 | if(n <= 10) 24 | { 25 | printf("%d ", n-1); 26 | n++; 27 | odd(); 28 | } 29 | return; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /Recurtion/fibonakki.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int i, n; 5 | printf("Enter a digit for fibonacci series: "); 6 | scanf("%d",&n); 7 | 8 | fibonacci(n); 9 | for (i=0; i 2 | int main() 3 | { 4 | int n; 5 | printf("Enter the number="); 6 | scanf("%d",&n); 7 | 8 | int result=factorial(n); 9 | 10 | printf("Factorial of %d = %d",n,result); 11 | 12 | } 13 | int factorial(int i) 14 | { 15 | if (i==1) 16 | { 17 | return 1; 18 | } 19 | else 20 | return i*factorial(i-1); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Recurtion/recartion.c: -------------------------------------------------------------------------------- 1 | #include 2 | int sum(int n); 3 | 4 | int main() { 5 | int number, result; 6 | 7 | printf("Enter a positive integer: "); 8 | scanf("%d",&number); 9 | 10 | result=sum(number); 11 | 12 | printf("sum = %d",result); 13 | return 0; 14 | } 15 | 16 | int sum(int n) { 17 | if (n!=0) 18 | // sum() function calls itself 19 | return n+sum(n-1); 20 | else 21 | return n; 22 | } 23 | -------------------------------------------------------------------------------- /Recurtion/reverse number.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n; 5 | printf("Enter number="); 6 | scanf("%d",&n); 7 | rfunc(n); // 1) function call from main 8 | 9 | return 0; 10 | } 11 | 12 | int rfunc(int a) //2) recursive function 13 | { 14 | if(a==0) 15 | return 0; 16 | else 17 | { 18 | printf("%d ",a); 19 | return rfunc(a-1); // 3) recursive call is made 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Recurtion/sum of natural number.c: -------------------------------------------------------------------------------- 1 | #include 2 | int sum(int a); 3 | 4 | int main() { 5 | int num, x; 6 | printf("Enter a number: "); 7 | scanf("%d",&num); 8 | 9 | x = sum(num); 10 | 11 | printf("sum of natural number = %d",x); 12 | return 0; 13 | 14 | } 15 | 16 | int sum(int a) 17 | { 18 | if (a!= 0) 19 | 20 | return a+sum(a-1); //sum() calls itself 21 | else 22 | return a; 23 | } 24 | -------------------------------------------------------------------------------- /Structure/Array of structure.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct person{ 4 | int age; 5 | int salary; 6 | }person[4]; 7 | 8 | int main() 9 | {int i; 10 | 11 | for(i=1;i<=4;i++) 12 | { 13 | printf("Give information person %d:\n",i); 14 | printf("Enter age="); 15 | scanf("%d",&person[i].age); 16 | printf("Enter salary="); 17 | scanf("%d",&person[i].salary); 18 | 19 | } 20 | printf("\n\n"); 21 | 22 | for(i=1;i<=4;i++) 23 | { 24 | printf("Information person %d:\n",i); 25 | printf("Enter age=%d\n\n",person[i].age); 26 | 27 | printf("Enter salary=%d\n",person[i].salary); 28 | 29 | 30 | } 31 | 32 | return 0; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Structure/Array of structure.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Structure/Array of structure.exe -------------------------------------------------------------------------------- /Structure/Array of structure.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Structure/Array of structure.o -------------------------------------------------------------------------------- /Structure/Array within structure.c: -------------------------------------------------------------------------------- 1 | #include 2 | struct person{ 3 | char name[20]; 4 | int age; 5 | int salary; 6 | }person[4]; 7 | 8 | int main() 9 | {int i; 10 | for(i=1;i<=4;i++) 11 | { 12 | printf("Give information person %d:\n",i); 13 | 14 | fflush(stdin); 15 | 16 | printf("Enter name="); 17 | gets(person[i].name); 18 | printf("Enter age="); 19 | scanf("%d",&person[i].age); 20 | printf("Enter salary="); 21 | scanf("%d",&person[i].salary); 22 | 23 | } 24 | printf("\n\n"); 25 | 26 | for(i=1;i<=4;i++) 27 | { 28 | printf("Information person %d:\n",i); 29 | 30 | printf("Name=%s\n",person[i].name); 31 | printf("Age=%d\n",person[i].age); 32 | printf("Salary=%d\n\n",person[i].salary); 33 | } 34 | getch(); 35 | return 0; 36 | 37 | } 38 | 39 | -------------------------------------------------------------------------------- /Structure/Array within structure.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Structure/Array within structure.exe -------------------------------------------------------------------------------- /Structure/Array within structure.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Structure/Array within structure.o -------------------------------------------------------------------------------- /Structure/Input structure element.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct person{ 4 | int age; 5 | int salary; 6 | }person1,person2; 7 | 8 | int main() 9 | { 10 | // person 2 11 | printf("Enter person2:\n"); 12 | printf("Enter age="); 13 | scanf("%d",&person1.age); 14 | 15 | printf("Enter salary="); 16 | scanf("%d",&person1.salary); 17 | 18 | printf("%d\n",person1.age); 19 | printf("%d\n",person1.salary); 20 | 21 | // person 2 22 | printf("\nEnter person 2:\n"); 23 | printf("Enter age="); 24 | scanf("%d",&person2.age); 25 | 26 | printf("Enter salary="); 27 | scanf("%d",&person2.salary); 28 | 29 | printf("%d\n",person2.age); 30 | printf("%d\n",person2.salary); 31 | 32 | printf("\nThank YOU"); 33 | 34 | return 0; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Structure/Input structure element.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Structure/Input structure element.exe -------------------------------------------------------------------------------- /Structure/Input structure element.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Structure/Input structure element.o -------------------------------------------------------------------------------- /Structure/Introduction to typedef.c: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Structure/Introduction to union.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | union test{ 4 | int a,b; 5 | }t1; 6 | 7 | int main() 8 | { 9 | 10 | t1.a=25; 11 | printf("t1.a=%d\n",t1.a); 12 | printf("t1.b=%d\n",t1.b); 13 | 14 | printf("\n"); 15 | 16 | t1.b=50; 17 | printf("t1.a=%d\n",t1.a); 18 | printf("t1.b=%d\n",t1.b); 19 | } 20 | -------------------------------------------------------------------------------- /Structure/Introduction to union.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Structure/Introduction to union.exe -------------------------------------------------------------------------------- /Structure/Introduction to union.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Structure/Introduction to union.o -------------------------------------------------------------------------------- /Structure/initialize structure variables.c: -------------------------------------------------------------------------------- 1 | #include 2 | struct person 3 | { 4 | int age; 5 | int salary; 6 | } person1,person2,person3; 7 | 8 | int main() 9 | { 10 | struct person person1= {27,3456}; 11 | 12 | // person 1 13 | printf("Enter person1:\n"); 14 | 15 | printf("%d\n",person1.age); 16 | printf("%d\n",person1.salary); 17 | 18 | // element wise assignment 19 | person2.age=34; 20 | person2.salary=57986; 21 | 22 | // person 2 23 | printf("\nEnter person 2:\n"); 24 | 25 | printf("%d\n",person2.age); 26 | printf("%d\n",person2.salary); 27 | 28 | // structure wise assignment 29 | person3=person2; 30 | 31 | printf("\nPerson 3:\n"); 32 | 33 | printf("%d\n",person3.age); 34 | printf("%d\n",person3.salary); 35 | 36 | printf("\nThank YOU"); 37 | 38 | return 0; 39 | 40 | } 41 | 42 | -------------------------------------------------------------------------------- /Structure/initialize structure variables.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Structure/initialize structure variables.exe -------------------------------------------------------------------------------- /Structure/initialize structure variables.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Structure/initialize structure variables.o -------------------------------------------------------------------------------- /Structure/local ,global.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct winner{ 4 | char code; 5 | int num; 6 | }winner1; 7 | 8 | int main() 9 | { 10 | printf("Enter the code=");9 11 | scanf("%s",&winner1.code); 12 | 13 | printf("Enter the number="); 14 | scanf("%d",&winner1.num); 15 | 16 | printf("%s\n",winner1.code); 17 | 18 | printf("%d\n",winner1.num); 19 | 20 | 21 | 22 | return 0; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Structure/local ,global.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Structure/local ,global.exe -------------------------------------------------------------------------------- /Structure/local ,global.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Structure/local ,global.o -------------------------------------------------------------------------------- /Structure/passing structure variable to function.c: -------------------------------------------------------------------------------- 1 | #include 2 | struct person{ 3 | char name[30]; 4 | int age; 5 | int salary; 6 | }person1,person2; 7 | 8 | int main() 9 | { 10 | strcpy(person1.name,"S.M. Sajjad Hossain JIM"); 11 | person1.age=24; 12 | person1.salary=12550; 13 | show(person1); 14 | 15 | strcpy(person2.name,"Mr. Kasem Mia"); 16 | person2.age=24; 17 | person2.salary=13550; 18 | show(person2); 19 | 20 | 21 | } 22 | void show(struct person p) 23 | { 24 | printf("Name=%s\n",p.name); 25 | printf("Age=%d\n",p.age); 26 | printf("Salary=%d\n\n",p.salary); 27 | } 28 | -------------------------------------------------------------------------------- /Structure/passing structure variable to function.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Structure/passing structure variable to function.exe -------------------------------------------------------------------------------- /Structure/passing structure variable to function.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Structure/passing structure variable to function.o -------------------------------------------------------------------------------- /Structure/recartion.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Structure/recartion.exe -------------------------------------------------------------------------------- /Structure/recartion.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Structure/recartion.o -------------------------------------------------------------------------------- /Structure/size of union and structure.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | union test1{ 4 | int x,y 5 | }t1; 6 | 7 | struct test2{ 8 | char name[10]; 9 | float x; 10 | int y; 11 | }t2; 12 | 13 | union test3{ 14 | char name[10]; 15 | double x; 16 | }t3; 17 | 18 | struct test4{ 19 | int x,y,z; 20 | double a; 21 | }t4; 22 | 23 | int main() 24 | { 25 | printf("Size of T1=%d\n",sizeof(t1)); 26 | printf("Size of T2=%d\n",sizeof(t2)); 27 | printf("Size of T3=%d\n",sizeof(t3)); 28 | printf("Size of T4=%d\n",sizeof(t4)); 29 | } 30 | -------------------------------------------------------------------------------- /Structure/size of union and structure.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Structure/size of union and structure.exe -------------------------------------------------------------------------------- /Structure/size of union and structure.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Structure/size of union and structure.o -------------------------------------------------------------------------------- /Structure/structure comparison.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | struct person{ 4 | int age; 5 | int salary; 6 | }person1,person2,person3; 7 | 8 | int main() 9 | { 10 | // person 2 11 | printf("Enter person2:\n"); 12 | printf("Enter age="); 13 | scanf("%d",&person1.age); 14 | printf("Enter salary="); 15 | scanf("%d",&person1.salary); 16 | 17 | // person 2 18 | printf("\nEnter person 2:\n"); 19 | printf("Enter age="); 20 | scanf("%d",&person2.age); 21 | printf("Enter salary="); 22 | scanf("%d",&person2.salary); 23 | 24 | // Compare strusture 25 | if (person1.age==person2.age) 26 | printf("\nBoth age are equal\n"); 27 | 28 | else if(person1.salary==person2.salary) 29 | printf("\nBoth Salary are Equal\n"); 30 | 31 | else 32 | printf("\nNot equal \n"); 33 | 34 | printf("\nThank YOU"); 35 | 36 | return 0; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /Structure/structure comparison.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Structure/structure comparison.exe -------------------------------------------------------------------------------- /Structure/structure comparison.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/Structure/structure comparison.o -------------------------------------------------------------------------------- /loop/10.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int main() 4 | { 5 | 6 | float number[4]; 7 | for(int i = 0; i < 4; i++) 8 | { 9 | 10 | scanf("%f", &number[i]); 11 | } 12 | float greatest = number[0], smallest = number[0]; 13 | for(int i = 0; i < 4; i++) 14 | { 15 | if(number[i] > greatest) 16 | { 17 | greatest = number[i]; 18 | } 19 | if(number[i] < smallest) 20 | { 21 | smallest = number[i]; 22 | } 23 | } 24 | float sum = greatest + smallest; 25 | if(sum > 5 && sum < 9) { 26 | printf("Ground"); 27 | } else if(sum >= 9) 28 | { 29 | printf("Roof"); 30 | } else if(sum < 6) 31 | { 32 | printf("Too small"); 33 | } 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /loop/10.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/10.exe -------------------------------------------------------------------------------- /loop/10.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/10.o -------------------------------------------------------------------------------- /loop/G.C.D & L.C.M.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | int num1, num2, GCD, LCD,n1,n2,temp; 6 | 7 | printf("Enter two numbers:"); 8 | scanf("%d %d",&num1,&num2); 9 | 10 | n1=num1; 11 | n2=num2; 12 | 13 | while(n2!=0) 14 | { 15 | temp=n1%n2; 16 | n1=n2; 17 | n2=temp; 18 | } 19 | GCD=n1; 20 | LCD=(num1*num2)/GCD; 21 | printf("GCD of %d and %d = %d\n",num1,num2,GCD); 22 | printf("LCM of %d and %d = %d\n",num1,num2,LCD); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /loop/G.C.D & L.C.M.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/G.C.D & L.C.M.o -------------------------------------------------------------------------------- /loop/Series 3.c: -------------------------------------------------------------------------------- 1 | //1*2 + 2*3 + 3*4.......n1*n2 = ? 2 | #include 3 | int main() 4 | { 5 | int sum=0,n1,n2,a=1,b=2; 6 | printf("Enter last two value="); 7 | scanf("%d %d",&n1,&n2); 8 | printf("1*2 + 2*3 + 3*4.......%d*%d",n1,n2); 9 | while(a<=n1 && b<=n2) 10 | { 11 | sum = sum + a*b; 12 | a=a+1; 13 | b=b+1; 14 | 15 | } 16 | printf("=%d",sum); 17 | getch(); 18 | } 19 | -------------------------------------------------------------------------------- /loop/Series 3.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/Series 3.exe -------------------------------------------------------------------------------- /loop/Series 3.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/Series 3.o -------------------------------------------------------------------------------- /loop/Untitled3.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/Untitled3.exe -------------------------------------------------------------------------------- /loop/Untitled3.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/Untitled3.o -------------------------------------------------------------------------------- /loop/armstrong number.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int sum=0,num,temp,r; 5 | printf("Enter a number:"); 6 | scanf("%d",&num); 7 | temp=num; 8 | while(temp!=0) 9 | { 10 | r=temp%10; 11 | sum=sum+r*r*r; 12 | temp=temp/10; 13 | } 14 | if(sum==num) 15 | printf("Armstrong Number"); 16 | else 17 | printf("Not Armstrong Number"); 18 | getch(); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /loop/armstrong number.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/armstrong number.exe -------------------------------------------------------------------------------- /loop/armstrong number.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/armstrong number.o -------------------------------------------------------------------------------- /loop/calculator.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | double num1,num2,result; 5 | char op; 6 | printf(" WELCOME TO MATH OPERATOR\n\n"); 7 | 8 | 9 | printf("Choice the operator which you want to try (+,-,*,/) :"); 10 | scanf("%c",&op); 11 | printf("\n"); 12 | printf("Enter two number for calculate="); 13 | scanf("%lf %lf",&num1,&num2); 14 | switch(op) 15 | { 16 | case '+': 17 | { 18 | result=num1+num2; 19 | printf(" The substrac value =%2.lf+%.2lf=%.2lf",num1,num2,result); 20 | break; 21 | } 22 | case '-': 23 | { 24 | result=num1-num2; 25 | printf(" The minus value =%.2lf -%.2lf%=.2lf",num1,num2,result); 26 | break; 27 | } 28 | 29 | case '*': 30 | { 31 | result=num1*num2; 32 | printf("The Multiple value=%.2lf*%.2lf=%.2lf",num1,num2,result); 33 | break; 34 | } 35 | case '/': 36 | { 37 | result=num1/num2; 38 | printf(" THE Divide value is=%.2lf/%.2lf=%.2lf",num1,num2,result); 39 | break; 40 | } 41 | default : 42 | printf("Not a valied oprration"); 43 | 44 | } 45 | return 0; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /loop/calculator.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/calculator.exe -------------------------------------------------------------------------------- /loop/calculator.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/calculator.o -------------------------------------------------------------------------------- /loop/count digit.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int num,count=0; 5 | printf("Enter A number:"); 6 | scanf("%d",&num); 7 | while(num!=0) 8 | { 9 | num=num/10; 10 | ++count; 11 | } 12 | printf("Total Number of digit:%d",count); 13 | 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /loop/count digit.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/count digit.exe -------------------------------------------------------------------------------- /loop/count digit.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/count digit.o -------------------------------------------------------------------------------- /loop/critical while.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int ID; 5 | int hello=1; 6 | 7 | scanf("%d",&ID); 8 | ID = (ID%3)+3; 9 | 10 | while(ID--) 11 | { 12 | printf("%d\n",ID); 13 | for(hello = 1; hello< 5; hello=hello*2) 14 | { 15 | if(ID%2 == 0) 16 | continue; 17 | printf("!Double Trouble without break!\n"); 18 | } 19 | 20 | if(ID%2 == 1) 21 | printf("\t Ki hoitese kisui bujhtesi na. \t...\n"); 22 | } 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /loop/do while loop.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int i=1; // initialization 5 | do 6 | { 7 | printf("%d\n",i); 8 | i++; 9 | } 10 | while(i<=100); // condition 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /loop/do while loop.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/do while loop.exe -------------------------------------------------------------------------------- /loop/do while loop.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/do while loop.o -------------------------------------------------------------------------------- /loop/factoriaal.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int i,num,fact=1; 5 | printf("Enter Any Positive number:"); 6 | scanf("%d",&num); 7 | for(i=1; i<=num; i++) 8 | { 9 | fact=fact*i; 10 | } 11 | printf("%d\n",fact); 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /loop/fibonakki.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int first=0,second=1,count,fibo,n; 5 | printf("Enter the Fibonakki Range="); 6 | scanf("%d",&n); 7 | while(count 3 | int main() 4 | { 5 | int i; 6 | for(i=1; i<=100; i++) 7 | { 8 | printf(" My name is Jim \n"); 9 | printf("%d",i); 10 | } 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /loop/for loop.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/for loop.exe -------------------------------------------------------------------------------- /loop/for loop.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/for loop.o -------------------------------------------------------------------------------- /loop/number series using for.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int i,n,sum=0; 5 | printf("Enter the last value="); 6 | scanf("%d",&n); 7 | for (i=1; i<=n ; i++) 8 | { 9 | sum=sum+i*i; 10 | 11 | } 12 | printf("sum= %d",sum); 13 | 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /loop/number series using for.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/number series using for.exe -------------------------------------------------------------------------------- /loop/number series using for.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/number series using for.o -------------------------------------------------------------------------------- /loop/number show.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int i,n; 5 | printf("Enter the last number ="); 6 | scanf("%d",&n); 7 | for (i=1; i<=n; i++) 8 | { 9 | printf("%d\n",i); 10 | } 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /loop/number show.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/number show.exe -------------------------------------------------------------------------------- /loop/number show.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/number show.o -------------------------------------------------------------------------------- /loop/positive number sum'.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int num,temp,sum=0,r; 5 | printf("Enter Any number:"); 6 | scanf("%d",&num); 7 | temp=num; 8 | while(temp!=0) 9 | { 10 | r=temp%10; 11 | sum=sum+r; 12 | temp=temp/10; 13 | } 14 | printf("Sum Of Digit=%d",sum); 15 | getch(); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /loop/positive number sum'.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/positive number sum'.exe -------------------------------------------------------------------------------- /loop/positive number sum'.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/positive number sum'.o -------------------------------------------------------------------------------- /loop/practice.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int sum=0,num,temp,r; 5 | printf("Enter a number:"); 6 | scanf("%d",&num); 7 | temp=num; 8 | while(temp!=0) 9 | { 10 | r=temp%10; 11 | sum=sum+r*r*r; 12 | temp=temp/10; 13 | } 14 | if(sum==num) 15 | printf("Armstrong Number"); 16 | else 17 | printf("Not Armstrong Number"); 18 | getch(); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /loop/practice.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/practice.exe -------------------------------------------------------------------------------- /loop/practice.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/practice.o -------------------------------------------------------------------------------- /loop/reverse number.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int num,temp,r,sum=0; 5 | printf("Enter Number="); 6 | scanf("%d",&num); 7 | 8 | temp=num; 9 | 10 | while(temp!=0) 11 | { 12 | r = temp % 10; 13 | sum = sum *10 + r; 14 | temp = temp/10; 15 | } 16 | printf("The sum of number=%d",sum); 17 | return 0; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /loop/reverse number.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/reverse number.exe -------------------------------------------------------------------------------- /loop/reverse number.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/reverse number.o -------------------------------------------------------------------------------- /loop/series ...c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n,i,sum=0; 5 | printf("Enter thr last value of series="); 6 | scanf("%d",&n); 7 | printf("1 + 3 + 5.....N"); 8 | for(i=1 ; i<=n; i=i+2) 9 | { 10 | sum=sum+i; 11 | } 12 | printf("=%d",sum); 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /loop/series 1.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int n,i,sum=0; 5 | printf("Enter series last number="); 6 | scanf("%d",&n); 7 | printf("1 + 2 + 3 +.....%d",n); 8 | for(i=1; i<=n ; i=i+1) 9 | { 10 | sum=sum+i; 11 | } 12 | printf("=%d",sum); 13 | getch(); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /loop/series 1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/series 1.exe -------------------------------------------------------------------------------- /loop/series 1.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/series 1.o -------------------------------------------------------------------------------- /loop/series 2.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main () 3 | { 4 | int sum=0,n,a=1; 5 | printf("Enter the series last value="); 6 | scanf("%d",&n); 7 | printf("1+2+3.....+N",n); 8 | while(a<=n) 9 | { 10 | sum=sum+a; 11 | a=a+1; 12 | } 13 | printf("=%d",sum); 14 | getch(); 15 | } 16 | -------------------------------------------------------------------------------- /loop/series 2.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/series 2.exe -------------------------------------------------------------------------------- /loop/series 2.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/series 2.o -------------------------------------------------------------------------------- /loop/series Hard.c: -------------------------------------------------------------------------------- 1 | //1-2+3-4..........N 2 | //(1+3+5.....N)-(2+4+6.....N) 3 | 4 | #include 5 | int main() 6 | { 7 | int n,i,even=0,odd=0; 8 | printf("1-2+3-4+-6........N\n"); 9 | printf("Enter the series last number value N="); 10 | scanf("%d",&n); 11 | for(i=1; i<=n; i++) 12 | { 13 | if(i%2==0) 14 | even=even+i; 15 | else 16 | odd=odd+i; 17 | } 18 | 19 | printf("Result=%d\n",odd-even); 20 | } 21 | -------------------------------------------------------------------------------- /loop/series multiple.c: -------------------------------------------------------------------------------- 1 | //1^2 * 2^2 * 3^2......N^2 2 | 3 | #include 4 | int main() 5 | { 6 | int i,n,result=1; 7 | printf("1^2 * 2^2 * 3^2......N^2\n"); 8 | printf("Enter value N="); 9 | scanf("%d",&n); 10 | for(i=1; i<=n; i++) 11 | { 12 | result=result *i*i; 13 | } 14 | printf("Result=%d\n",result); 15 | getch(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /loop/series multiple.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/series multiple.exe -------------------------------------------------------------------------------- /loop/series multiple.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/series multiple.o -------------------------------------------------------------------------------- /loop/series power.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int x, i, s; 5 | printf("Enter a number="); 6 | scanf("%d",&x); 7 | int b =x-1; 8 | for(i=0;i<=b;i++) 9 | { 10 | s = pow(x,i); 11 | printf("%d + ",s); 12 | 13 | } 14 | printf("N^(n-1)"); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /loop/series power.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/series power.exe -------------------------------------------------------------------------------- /loop/series power.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/series power.o -------------------------------------------------------------------------------- /loop/special formate outup show.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | int main() 4 | { 5 | char a='1'; 6 | do 7 | { 8 | int b=a++; 9 | printf("The value of a=\"%c\" & b=\"%05d\"\n",a,b); 10 | } 11 | while((a++)<57); 12 | return 100; 13 | } 14 | /* 15 | 16 | #include 17 | int main() 18 | { 19 | char a='1'; 20 | while(a<58) 21 | { 22 | int b=a++; 23 | printf("a=\"%c\" & b \"%05d\" \n ",b,a); 24 | 25 | if(a=='5') 26 | 27 | break; 28 | } 29 | 30 | return 0; 31 | } 32 | */ 33 | -------------------------------------------------------------------------------- /loop/special formate outup show.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/special formate outup show.exe -------------------------------------------------------------------------------- /loop/special formate outup show.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/special formate outup show.o -------------------------------------------------------------------------------- /loop/sum 1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/sum 1.exe -------------------------------------------------------------------------------- /loop/sum 1.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/sum 1.o -------------------------------------------------------------------------------- /loop/sum of digit.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int num,temp,r,sum=0; 5 | printf("Enter Number="); 6 | scanf("%d",&num); 7 | 8 | temp=num; 9 | 10 | while(temp!=0) // sum of digit // 11 | { 12 | r = temp % 10; 13 | sum = sum + r; 14 | temp = temp/10; 15 | } 16 | printf("The sum of number=%d",sum); 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /loop/sum of digit.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/sum of digit.exe -------------------------------------------------------------------------------- /loop/sum of digit.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/sum of digit.o -------------------------------------------------------------------------------- /loop/sum series.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | double i,n,sum=0; 5 | printf("Enter the last value="); 6 | scanf("%lf",&n); 7 | printf("1+ 1/2 +1/3.......1/%.lf",n); 8 | for (i=1; i<=n ; i++) 9 | { 10 | sum= sum+(1/i); 11 | 12 | } 13 | printf(" sum= %.2lf",sum); 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /loop/sum series.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/sum series.exe -------------------------------------------------------------------------------- /loop/sum series.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/sum series.o -------------------------------------------------------------------------------- /loop/sum.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main () 3 | { 4 | int n,i,sum=0; 5 | printf("Enter the last value="); 6 | scanf("%d",&n); 7 | for(i=1; i<=n;i++) 8 | { 9 | printf("%d+",i); 10 | sum=sum+i; 11 | } 12 | printf("=%d",sum); 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /loop/sum.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/sum.exe -------------------------------------------------------------------------------- /loop/sum.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sajjadjim/C_Programming/931ae284c751389da0cc90013ce9e1a01d219000/loop/sum.o -------------------------------------------------------------------------------- /loop/value.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main() 3 | { 4 | int num,temp,sum=0,rem; 5 | scanf("%d",&num); 6 | temp=num; 7 | while(temp!=0) 8 | { 9 | rem=temp%10; 10 | sum=rem+sum*10; 11 | temp=temp/10; 12 | } 13 | printf("%d",sum); 14 | 15 | } 16 | --------------------------------------------------------------------------------