[QUOTE=anu john;416424]Ye. it will be a kit with ethernet chip n rj45 connections.therefor the tcp/ip protocols needed will be taken care of..
nw i need to program my controller using c language in a way that i can access my sql server 2005 on a remote machine...Also im trying to find out if keil compiler supports vc++, since i know that sql can be connected using this language...
plz reply...[/QUOTE]

Then i think most simple way to achieve this is:

  1. run your own web server somewhere on net.
  2. connect web server to SQL database through PHP or other methods.
  3. make HTTP calls (POST/GET) from your ethernet chip to that web server.

So that is communication will be =>
your controller <-> http server <-> sql server

[CODE=C]

define TRUE 1

// init composite[i] to zero
void FindPrimes(int composite[], int until)
{
for (int i = 2; i < until; i++)
{
// if number i is not composite number or in other words - if it is prime number
if (!composite[i])
{
// find out all multiples of i
for (int j = i + i; j <= until; j += i)
{
composite[j] = TRUE;
}
}
}
}
[/CODE]
After this function execution number [ICODE]i[/ICODE] will be prime if [ICODE]composite[i]==0[/ICODE]. Optimize this example by your needs (p squared and such).

I can only say hints:

  1. Use [CODE]char* token=strtok(string,"()")[/CODE] to read tokens from expression.
  2. Use [CODE]sscanf(token,"%d%c%d",&arg1,&operator,&arg2)[/CODE] to read int's and operator character from token.
  3. Write [CODE]switch(operator) {/case by operator type/}{[/CODE] and perform arithmetic actions on these arg1, arg2 variables.
  4. Construct new string composed of old one but with your computed result instead of old () expression.
  5. Repeat everything from 1, until no parentheses left.

[QUOTE=vino4all;1184841]I'm getting
1
12
345
6789

by using the following code. Help me to get the expected code.

[code=c]

include <stdio.h>
include <conio.h>

int main()
{
int i,j,m=0;
clrscr();
for (i=0;i<4;i++)
{
for(k=1;k<=31-i;k++)printf(" ");
if(i==0)
// use space here
printf(" 1");
else
for (j=i+1;j>=1 ;j-- )
{
m=m+1;
// and space here
printf(" %d",m);
}
printf("\n");
}
getch();

return 0;

}

[/code][/QUOTE]
Then you get equilateral triangle (more or less so...).
Good luck!

WaltP commented: Did this post serve any useful purpose? -2