Monday, May 24, 2010

C-programming...beginners..pro... plz help me out?

i need a program written in C on finding roots of a quadratic equations and finding the average of n even numbers. I need the programming. Or plz refer any website from where i can download the same. got assignment tommorow.

C-programming...beginners..pro... plz help me out?
Well Ill tell ya. If this is the type of student you are then the teacher is going to know you didnt write the code.





So you get a zero on the assignment or you receive a zero and punished for cheating.





Do your assignments on time and study more...any other answer to this question is morally corrupt.
Reply:Here u'll find dat
Reply:#include%26lt;stdio.h%26gt;


#include%26lt;math.h%26gt;


void main()


{


int a,b,c;





printf("enter the values of a b %26amp;c");


scanf("%d %d %d",%26amp;a,%26amp;b,%26amp;c);





if(b*b%26gt;=4*a*c)


{


rt1=(-b*b+sqrt(b*b-4*a*c))/(2*a);


rt2=(-b*b-sqrt(b*b-4*a*c))/(2*a);


}


else


printf("complex roots");





}








//average of n numbers


#include%26lt;stdio.h%26gt;





void main()


{


int num[100],n=1;i=1;


printf("enter the total no of numbers u want to enter");


scanf("%d",%26amp;n);








#include%26lt;stdio.h%26gt;


#include%26lt;math.h%26gt;


void main()


{


int a,b,c;





printf("enter the values of a b %26amp;c");


scanf("%d %d %d",%26amp;a,%26amp;b,%26amp;c);





if(b*b%26gt;=4*a*c)


{


rt1=(-b*b+sqrt(b*b-4*a*c))/(2*a);


rt2=(-b*b-sqrt(b*b-4*a*c))/(2*a);


}


else


printf("complex roots");





}








//average of n numbers


#include%26lt;stdio.h%26gt;





void main()


{


float num[100],n=1;i=1,sum=0;avg=0;


printf("enter the total no of numbers u want to enter1%26lt;=n%26lt;=100");


scanf("%f",%26amp;num[i-1]);








for(i=1;i%26lt;=n;i++)


{


printf("enter the new number ");


scanf("%f",%26amp;i);


}








for(i=1;i%26lt;=n;i++)


{


sum=sum+num[i-1];


}


avg=sum/n;





printf("the average of %f nos is:%f",n,avg);





}


No comments:

Post a Comment