Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sayeemzzzaman committed Oct 17, 2021
0 parents commit a8efe41
Show file tree
Hide file tree
Showing 123 changed files with 1,723 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"files.associations": {
"stdio.h": "c",
"stdlib.h": "c"
}
}
15 changes: 15 additions & 0 deletions array_1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include <stdio.h>
#include <stdlib.h>
//marks of five students in math
int main()
{
double maths[5] = {90.2,44,57,85,90.5};

int roll;

for(roll = 1;roll <= 5;roll ++){

printf("Roll %d Marks %.2lf\n",roll,maths[roll - 1]);
}
return 0;
}
12 changes: 12 additions & 0 deletions array_2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <stdio.h>
#include <stdlib.h>
//Print some numbers backwords
int main()
{
int n[5] = {5,8,13,16,18},i;

for(i = 4;i >= 0; i-- ){
printf("%d\n",n[i]);
}
return 0;
}
44 changes: 44 additions & 0 deletions array_3.2D.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#include <stdio.h>
#include <stdlib.h>

//marks of class 6 and 7 of 10 students
int main()

{

double maths[2][5];

int c,r;

printf("Input the marks of 10 students in class 6 & 10:\n");
for(c = 0;c < 2; c++)

{

for(r = 0;r < 5; r++)

{

scanf("%lf",&maths[c][r]);

}

}

for(c = 0;c < 2; c++)

{

for(r = 0;r < 5; r++)

{

printf("Class %d Roll %d Marks %.2lf\n",c+6,r+1,maths[c][r]);

}

}

return 0;

}
16 changes: 16 additions & 0 deletions demo.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include<stdio.h>

int main()
{
int n,i,count=0;
char name;
float total,c2,r2,s2,c=0,r=0,s=0,num;
scanf("%d",&n);
printf("%d",n);
for(i=1;i<=n;i++)
{
scanf("%f%c",&num,&name);
scanf("%c",&name);
printf("%d %d\n",i,n);
}
}
Binary file added demo.exe
Binary file not shown.
12 changes: 12 additions & 0 deletions even numbers(For_loop).c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <stdio.h>
#include <stdlib.h>

int main()
{
int n;

for (n = 2; n<=100; n = n+2){
printf("%d\n",n);
}
return 0;
}
19 changes: 19 additions & 0 deletions even_number(while loop).c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <stdio.h>
#include <stdlib.h>

int main()
{
int n;

n = 1;

while (n<=100){
if (n%2 == 0) {
printf("%d\n",n);

}
n = n+1;
}

return 0;
}
18 changes: 18 additions & 0 deletions even_numbers.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include<stdio.h>

int main()
{
int x,y,k;
scanf("%d",&y);
for(x=1;x<=y;x++)
{
for(k=x;k<y;k++)
{
printf(" ");
}
for(k=1;k<=x;k++)
{
printf("*");
}printf("\n");
}
}
14 changes: 14 additions & 0 deletions for_loop.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <stdio.h>
#include <stdlib.h>

int main()
{
int n;

for (n = 1; n<=100; n=n+1){
printf("%d\n",n);
}


return 0;
}
28 changes: 28 additions & 0 deletions function.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <stdio.h>
#include <stdlib.h>

int minimum(int x,int y)
{
int temp;

if(x < y){
temp = x;
}
else {
temp = y;
}
return temp;
}
int main()
{
int a,b,c,small,s;

scanf("%d%d%d",&a,&b,&c);

s = minimum(a,b);

small = minimum(s,c);

printf("The smaller number is %d\n",small);
return 0;
}
23 changes: 23 additions & 0 deletions function_2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <stdio.h>
#include <stdlib.h>

int square(int x)
{
int y;

y = x*x;

return y;
}
int main()
{
int a,sqr;

scanf("%d",&a);

sqr = square(a);

printf("The square of %d is %d\n",a,sqr);

return 0;
}
61 changes: 61 additions & 0 deletions grade_System.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#include <stdio.h>
#include <stdlib.h>



main() {



int x;
char ch;
char ce;

printf("Enter your number:\n");
scanf("%d",&x);
if (x<=100&& x>=80){
ch='A';
ce='+';
printf("Your grade is %c%c",ch,ce);
}

else if (x<=79&&x>=70){
ch='A';
printf ("Your grade is %c",ch);
}

else if (x<=69&&x>=60) {
ch='A';
ce='-';
printf("Your grade is %c%c",ch,ce);

}

else if (x<=59&&x>=50) {
ch='B';
printf ("Your grade is %c",ch);
}

else if (x<=49&&x>=40) {
ch='C';
printf("Your grade is %c",ch);
}

else if (x<=39&&x>=33) {
ch='D';
printf ("Your grade is %c",ch);
}

else if (x<33&&x>=0) {
ch='F';
printf ("Your grade is %c",ch);
}


else {
printf ("Wrong Input");
}


return 0;
}
28 changes: 28 additions & 0 deletions print_sum_average_maximum.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include<stdio.h>

int main()
{

float n,sum=0,count=0,max=0,i,num;
printf("How many numbers? ");
scanf("%f",&n);

for(i=1;i<=n;i++)
{
scanf("%f",&num);
sum+=num;
count++;
if(max < num)
{
max=num;
}

}

printf("The sum is: %.1f\n",sum);
printf("The average is: %.2f\n",sum/n);
printf("The maximum is: %.1f\n",max);

return 0;

}
Binary file added print_sum_average_maximum.exe
Binary file not shown.
18 changes: 18 additions & 0 deletions problem_1001.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <stdio.h>
#include <stdlib.h>


int main()
{
int A,B,X;

scanf("%d",&A);

scanf("%d",&B);

X=A+B;

printf("X = %d\n",X);

return 0;
}
12 changes: 12 additions & 0 deletions problem_1002.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define n 3.14159
int main()
{
double R,A;
scanf("%lf",&R);
A=n*pow(R,2);
printf("A=%.4lf\n",A);
return 0;
}
11 changes: 11 additions & 0 deletions problem_1003.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <stdio.h>
#include <stdlib.h>

int main()
{
int A,B,SOMA;
scanf("%d%d",&A,&B);
SOMA=A+B;
printf("SOMA = %d\n",SOMA);
return 0;
}
11 changes: 11 additions & 0 deletions problem_1004.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <stdio.h>
#include <stdlib.h>

int main()
{
int A,B,PROD;
scanf("%d%d",&A,&B);
PROD=A*B;
printf("PROD = %d\n",PROD);
return 0;
}
13 changes: 13 additions & 0 deletions problem_1005.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <stdio.h>
#include <stdlib.h>

int main()
{
double A,B,MEDIA;
scanf("%lf%lf",&A,&B);
A=A*3.5;
B=B*7.5;
MEDIA=(A+B)/11;
printf("MEDIA = %.5lf\n",MEDIA);
return 0;
}
Loading

0 comments on commit a8efe41

Please sign in to comment.