Thanks a lot :)
Type: Posts; User: rajarshi
Thanks a lot :)
I defined an array at run-time and made two seperate functions to insert and delete the elements from an array
The problem is that the scanf on line 20 takes 2 value for n (while it should take 1...
line 64-78 searches for the same powers of x and y in the array...
and when the power matches.....it adds the coefficients to one place and leaves the coefficient of the other place as 0 ....
5 hrs into the thread still no one replied :o :(
HI
I want to add two polynomials
5x^2 - 3xy + y
and
2x^2 - y^2 + 5xy - x + y
using arrays .
I used one array to store the coefficient,power of x ,power of y for the subsequent terms of the...
use the pointer power to reverse the string...and then compare both the string to know whether they are palindrome or not
#include <stdio.h>
int main ()
{
printf ("%d %d %d \n",-9%10,-11%10,-1%10);
}
In C the ouput is : -9 -1 -1
in pure mathematics : -9/+1 -1/+9 -1/+9
This isn't bulls**t...this is pure number theory in mathematics !! :wink:
funny cuz...we got to live with it..and we can do absolutely nothing about it...
another flaw which I feel is (personal opinion)...operation between an integer and real always yields a real...
the only thing u can do is to use pointers...if u want to send numcount to main....else u can print the numcount in the insertion sort function itself...
to pass pointers...1st globally declare the...
LOL :wink:
scanf() does assigns a char/int/float to appropriate variables and keeps the enter key unread in the keyboard buffer.
getchar() will read the enter key from the buffer thinking the user has entered...
number line is not circular...
but the mod operator when implemented on the number line performs the particular action on a circular path...
like while using a mod operator..
u can get answers as...
there is a convention...to can pick up any higher mathematics number theory book and u can find it...
well the practical application is like this...
think of a clock..the clocks' entire clock...
cuz if u add 1 to 9 u get 10 (which is divisible by 10....10%10=0)
so, in mathematics we use two conventions...
9%10 = 9
also
9%10= -1
but C deals with only one aspect..(only the positive...
ok..so u have 10 nos..
u can select one number at a time (lets start wid the first)
n then compare it with rest of the array elements...
such as
for (j=1;j<=9;j++)
{if(arr[0]==arr[j])...
u can broaden ur concept by knowing that
-9 % 10 = -9
-1 % 10 = -1
-11 % 10 = -1
9 % 10 = 9
1 % 10 = 1
replace line 9 with
printf( "You entered %d \n", this_is_a_number);
In short u want to keep on adding nodes at the beginning of a linked list...right ??
why are u using head as a node (u are putting absolutely nothing in it....why are u allocating memory for it ??...
don't worry about the head pointer..
you can call a recursive function to keep adding nodes...(which i find easy..as saves a lot of time by not writting bulky codes)
then to delete any node..u got...
so u want everyone to do ur homework ??
It freezes all of a sudden...and doesn't proceeds further...
it crashes on line 69 (when the loop is executed 2nd time..as soon as I supply the value to the scanf the 2nd time it crashes)
But as u...
plz ignore that exit(0)
remove that exit(0)...I edited the code...don't why the exit(0) still appears
Enter the nodes to be created
5
Enter the data values to be placed in a node
1
Enter the data values to be placed in a node
2
(chrashes now)