diff --git a/3rd Sem (Data Structure)/array.c b/3rd Sem (Data Structure)/array.c new file mode 100644 index 0000000..b22de75 --- /dev/null +++ b/3rd Sem (Data Structure)/array.c @@ -0,0 +1,121 @@ +#include +#include +struct Student +{ +char name[25]; + int usn; + int m1,m2,m3; +}; +char filename[15]; +int n; +struct Student s; +void Insert() +{ +FILE *fp; +int i; +printf("\n\n\tEnter how many Records: "); +scanf("%d",&n); +fp=fopen(filename,"w"); +if(fp==NULL) printf("\n\n\tError in Creating the File...."); +else +for(i=0;i +#include +int main() { +inta,b,c; +printf("Enter the sides of the triangle:\n"); +scanf("%d%d%d",&a,&b,&c); +if((a<1 || a>10)&&(b<1 || b>10)&&(c<1 || c>10)) +printf("Sides a,b and c are of out of range"); +else if((a<1 || a>10)&&(b<1 || b>10)) +printf("Sides a and b are out of range"); +else if((b<1 || b>10)&&(c<1 || c>10)) +printf("Sides b and c are out of range"); +else if((a<1 || a>10)&&(c<1 || c>10)) +printf("Sides a and c are out of range"); +else if(a<1 || a>10) +printf("side a is out of range."); +else if(b<1 || b>10) +printf("side b is out of range."); +else if(c<1 || c>10) +printf("side c is out of range."); +else + +{ +if((a