-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
95 changed files
with
990 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include <stdio.h> | ||
int main() | ||
{ | ||
int n; | ||
scanf("%d\n",&n); | ||
int a[n]; | ||
for(int i=0;i<n;i++) | ||
{ | ||
scanf("%d ",&a[i]); | ||
} | ||
for(int i=0;i<=n-1;i++) | ||
{ | ||
for(int j=i+1;j<n;j++) | ||
{ | ||
if(a[i]>a[j]) | ||
{ | ||
int temp=a[i]; | ||
a[i]=a[j]; | ||
a[j]=temp; | ||
} | ||
} | ||
|
||
} | ||
for(int i=0;i<n;i++) | ||
{ | ||
printf("%d ",a[i]); | ||
} | ||
return 0; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <stdio.h> | ||
int main() | ||
{ | ||
int n,k; | ||
scanf("%d\n",&n); | ||
k=n; | ||
for(int i=0;i<n;i++) | ||
{ | ||
for(int j=0;j<k;j++) | ||
{ | ||
printf("*"); | ||
} | ||
k--; | ||
printf("\n"); | ||
} | ||
return 0; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <stdio.h> | ||
int main() | ||
{ | ||
int n,s,k; | ||
scanf("%d\n",&n); | ||
s=n-1; | ||
k=1; | ||
for(int i=0;i<n;i++) | ||
{ | ||
for(int j=0;j<s;j++) | ||
{ | ||
printf(" "); | ||
} | ||
for(int j=0;j<k;j++) | ||
{ | ||
printf("*"); | ||
} | ||
printf("\n"); | ||
s--; | ||
k++; | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <stdio.h> | ||
int main() | ||
{ | ||
int n,s,k; | ||
scanf("%d\n",&n); | ||
s=0; | ||
k=(2*n)-1; | ||
for(int i=0;i<n;i++) | ||
{ | ||
for(int j=0;j<s;j++) | ||
{ | ||
printf(" "); | ||
} | ||
for(int j=0;j<k;j++) | ||
{ | ||
printf("*"); | ||
} | ||
printf("\n"); | ||
s++; | ||
k=k-2; | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include <stdio.h> | ||
int main() | ||
{ | ||
int n,k,s; | ||
scanf("%d\n",&n); | ||
k=1; | ||
s=n-1; | ||
for(int i=0;i<n;i++) | ||
{ | ||
for(int j=0;j<s;j++) | ||
{ | ||
printf(" "); | ||
} | ||
for(int j=0;j<k;j++) | ||
{ | ||
printf("*"); | ||
} | ||
|
||
k+=2; | ||
s--; | ||
printf("\n"); | ||
} | ||
return 0; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include <stdio.h> | ||
int main() | ||
{ | ||
int n,k,s; | ||
scanf("%d\n",&n); | ||
s=n-1; | ||
k=1; | ||
for(int i=0;i<n;i++) | ||
{ | ||
for(int j=0;j<s;j++) | ||
{ | ||
printf(" "); | ||
} | ||
for(int j=0;j<k;j++) | ||
{ | ||
printf("*"); | ||
} | ||
printf("\n"); | ||
s--; | ||
k=k+2; | ||
} | ||
s=0; | ||
k=(2*n)-1; | ||
for(int i=0;i<n;i++) | ||
{ | ||
for(int j=0;j<s;j++) | ||
{ | ||
printf(" "); | ||
} | ||
for(int j=0;j<k;j++) | ||
{ | ||
printf("*"); | ||
} | ||
printf("\n"); | ||
s++; | ||
k=k-2; | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// #include <stdio.h> | ||
|
||
// void char_to_ascii() | ||
// { // step 1 : function syntax | ||
// char c; // step 2 : variable declaration | ||
// scanf("%c", &c); // step 3: input taking | ||
// printf("%d", c); // step 4 : value printing | ||
// } | ||
|
||
// int main() | ||
// { | ||
// char_to_ascii(); // function calling, switch on kora | ||
// return 0; | ||
// } | ||
|
||
#include <stdio.h> | ||
|
||
void char_to_ascii(char c) | ||
{ | ||
|
||
} | ||
|
||
int main() | ||
{ | ||
char c; | ||
scanf("%c", &c); | ||
char_to_ascii(c); | ||
printf("%d", c); | ||
|
||
return 0; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include<stdio.h> | ||
#include<math.h> | ||
#include<stdlib.h> | ||
int main() | ||
{ | ||
double x,y; | ||
scanf("%lf ",&x); | ||
// int ans=ceil(x); | ||
// int ans=floor(x); | ||
// int ans=round(x); | ||
// int ans=sqrt(x); | ||
int ans=abs(x); | ||
printf("%d\n",ans); | ||
return 0; | ||
|
||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include<stdio.h> | ||
|
||
// return_tyep name(parameter) | ||
// { | ||
// code | ||
// return what ? | ||
// } | ||
|
||
// tyep-1(easy) | ||
|
||
int sum(int x, int y) | ||
{ | ||
int sum= x + y; | ||
return sum; | ||
} | ||
|
||
int main() | ||
{ | ||
// int s=sum(10,40); | ||
int a,b; | ||
scanf("%d %d",&a,&b); | ||
printf("%d",sum(a,b)); | ||
return 0; | ||
} | ||
|
||
// type-2 | ||
|
||
// int sum(int x, int y); | ||
|
||
// int main() | ||
// { | ||
// int s=sum(10,50); | ||
// printf("%d",s); | ||
// return 0; | ||
// } | ||
// int sum(int x, int y) | ||
// { | ||
// int sum= x + y; | ||
// return sum; | ||
// } |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// #include<stdio.h> | ||
// int sum() | ||
// { | ||
// int a,b; | ||
// scanf("%d %d",&a,&b); | ||
// int s=a+b; | ||
// return s; | ||
// } | ||
// int main() | ||
// { | ||
// int s=sum(); | ||
// printf("%d",s); | ||
// return 0; | ||
// } | ||
|
||
#include<stdio.h> | ||
void m() | ||
{ | ||
printf("hi"); | ||
} | ||
int main() | ||
{ | ||
printf("hello"); | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include <stdio.h> | ||
void sum(int a,int b) | ||
{ | ||
int sum=a+b; | ||
printf("%d\n",sum); | ||
} | ||
int main() | ||
{ | ||
int a,b; | ||
scanf("%d %d",&a,&b); | ||
sum(a,b); | ||
return 0; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <stdio.h> | ||
void sum(void) | ||
{ | ||
int a,b; | ||
scanf("%d %d\n",&a,&b); | ||
int s=a+b; | ||
printf("%d\n",s); | ||
} | ||
int main() | ||
{ | ||
sum(); | ||
|
||
|
||
return 0; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
12 13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
500 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include<stdio.h> | ||
int main() | ||
{ | ||
int x=100; | ||
// printf("%p\n",&x); | ||
int* p=&x; | ||
// printf("%p\n",p); | ||
// derefrence | ||
// printf("%d\n",*p); | ||
*p=500; | ||
printf("%d\n",x); | ||
return 0; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include<stdio.h> | ||
// global | ||
int x=500; | ||
void fun(void) | ||
{ | ||
int s=100; | ||
printf("fun er x er address -%p\n",&x); | ||
|
||
} | ||
int main() | ||
{ | ||
int s=200; | ||
printf("main er x er address -%p\n",&x); | ||
fun(); | ||
return 0; | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include<stdio.h> | ||
void num(int n) | ||
{ | ||
for(int i=1;i<n;i++) | ||
{ | ||
printf("%d ",i); | ||
} | ||
printf("%d",n); | ||
|
||
} | ||
int main() | ||
{ | ||
int n; | ||
scanf("%d",&n); | ||
num(n); | ||
return 0; | ||
} | ||
|
||
|
||
// #include<stdio.h> | ||
// int main() | ||
// { | ||
// int n; | ||
// scanf("%d",&n); | ||
// for(int i=1;i<=n;i++) | ||
// { | ||
// printf("%d ",i); | ||
// } | ||
// return 0; | ||
// } |
Binary file not shown.
Oops, something went wrong.