Project Title:- (Serial Port Device Drivers)
Members:-
Gurpreet singh
Manoj Kumar
Pankaj Hooda
Pulkit Agarwal
Arun Goyal
…Thank you…
Project Title:- (Serial Port Device Drivers)
Members:-
Gurpreet singh
Manoj Kumar
Pankaj Hooda
Pulkit Agarwal
Arun Goyal
…Thank you…
To Prabhjot Sir
Batch ELARM 12(Group A)
Project Members :-
Amit Sharma
Shivjot Sharma
Abhinav Kainth
Dinesh Malhotra
Members-
Vikrant Salwan
Sheetal Sharma
Simarpreet Singh
Karan Sharma
#include
float fun(float,float);
int main()
{
float a;
printf(“enter 1st number :”);
scanf(“%f”,&a);
float b;
printf(“enter 2nd number :”);
scanf(“%f”,&b);
float c=fun(a,b);
printf(“%.2f”,c);
return 0;
}
float fun(float x,float y)
{
float sum=x+y;
int z=(int)sum;
if(sum-z > 0.12)
{
sum=sum+1.0;
sum=sum-0.12;
}
return sum;
}
#include
float fun(float,float);
int main()
{
float a=5.07;
float b=7.11;
float c=fun(a,b);
printf(“%.2f”,c);
return 0;
}
float fun(float x,float y)
{
float sum=x+y;
if(sum>12.12)
{
sum=sum+1.0;
sum=sum-0.12;
}
return sum;
}
Arrays assignment almost complete with 2 to 3 problems remaining
#include<stdio.h>
int main()
{
char a[]=”hello hellothethe hello the hello the hello”;
char b[]=”the”;
int c=0,i,j=0;
for(j=0;a[j]!=”;j++)
{
/* if(a[j]==’\t’||a[j]==’\n’||a[j]==’ ‘)
{
printf(“space\n”);
continue;
}
// else
*/ // {
i=0;
while(b[i]!=”)
{
if(b[i]!=a[j])
break;
i++;j++;
}
if(b[i]==”)
{
c++;
printf(“%d”,c);
}
else
{
while(a[j]!=”&& a[j]!=’ ‘) //it is working fine but there are double comparisons than in the next loop…
// while(a[j]!=’ ‘|| a[j]!=”) //why it not check the null condition…??? // while doing this case there is showing Garbage value at the end. because it is fail to check the character at the end of the string (which it should)… but there is half comparisons… so less execution time and complexity…
{
printf(“%c “,a[j]);
j++;
}
printf(“\n”);
}
// }
}
printf(“matched %d times\n”,c);
return 0;
}
please
char *a,*b; int c,n,i;
printf(“enter the word to be find: “);
a=malloc(10*sizeof(char));
b=malloc(100*sizeof(char));
printf(“Address of b %d”,b);
fgets(a,10,stdin); puts(a);
i=0;
printf(“len of the str:%d \n”,strlen(a));
//for(i=0;*(a+i)!=”;i++)
while(*(a+i)!=”)
{
printf(“length= %d\n”,i);
printf(“length======== %c\n”,*(a+i));
i++;
}
Is there any mechanism to remove garbage values from the pipe or FIFO.
As we are reading from pipe/FIFO there are some garbage value along with the desired result.
And in FIFO the behaviour is unexpected, as sometime the it read the exact values, sometime some garbage