-
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
0 parents
commit a8efe41
Showing
123 changed files
with
1,723 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,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
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,6 @@ | ||
{ | ||
"files.associations": { | ||
"stdio.h": "c", | ||
"stdlib.h": "c" | ||
} | ||
} |
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> | ||
#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; | ||
} |
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 @@ | ||
#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; | ||
} |
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,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; | ||
|
||
} |
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> | ||
|
||
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 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 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
int main() | ||
{ | ||
int n; | ||
|
||
for (n = 2; n<=100; n = n+2){ | ||
printf("%d\n",n); | ||
} | ||
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,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; | ||
} |
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,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"); | ||
} | ||
} |
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,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; | ||
} |
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,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; | ||
} |
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> | ||
#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; | ||
} |
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,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; | ||
} |
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,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 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,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; | ||
} |
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 @@ | ||
#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; | ||
} |
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,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; | ||
} |
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,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; | ||
} |
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> | ||
#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; | ||
} |
Oops, something went wrong.