[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


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;
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

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


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

int main()
int i,j,m=0;
for (i=0;i<4;i++)
for(k=1;k<=31-i;k++)printf(" ");
// use space here
printf(" 1");
for (j=i+1;j>=1 ;j-- )
// and space here
printf(" %d",m);

return 0;


Then you get equilateral triangle (more or less so...).
Good luck!

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