LED glow

int pin3= 3;
int pin5= 5;
int LEDPin8= 8;
int LEDPin11= 11;
int prev1=LOW;
int prev2=LOW;

void setup(){

// declaration of pin modes
pinMode(pin3, INPUT);
digitalWrite(pin3, HIGH);
pinMode(pin5, INPUT);
digitalWrite(pin3, LOW);
pinMode(LEDPin11, OUTPUT);

pinMode(LEDPin8, OUTPUT);

// begin sending over serial port
Serial.begin(9600);
}

void loop(){

if (pin3 == HIGH) {
prev1= LOW;}

else {
prev1 == HIGH;
}

pinMode(LEDPin8, prev1);

if (pin5 == LOW)
{
prev2= HIGH ;}

else {
prev2 == LOW;
}
pinMode(LEDPin11, prev2);
}

I have written the above code where I want that when switch1 is ON then LED1 glows & when the other switch2 is ON then the other LED glows.

Here is the circuit picture.
https://picasaweb.google.com/112167713973931126525/Mar72011?authkey=Gv1sRgCMDFkvak--eWvwE#5581296006397369330

The IDE has a useful feature that allows you to correct the formatting of your code automatically - press ctrl-T.

Also, please use the # icon on the editor's toolbar when posting code.

Was there a question in your post?

pinMode(pin3, INPUT);
  digitalWrite(pin3, HIGH);
pinMode(pin5, INPUT);
  digitalWrite(pin3, LOW);

Enable, then disable pin 3's pull-up. Why?

OK.. I will take care of it next time..

The LEDs aint glowing :frowning:

if (pin3 == HIGH)

You have given the variable "pin3" the value 3, so it can never == 1.

I assigned pin numbers there.
If not there then where do I assign Pin Numbers? I want digital input & output from those pins

Perhaps you need to actually read the value of the pin, somewhere, using digitalRead().

Can you explain why you have two R1s in your diagram, and why two series current limiters on the LEDs?
What is the right-most R1?

Here is the edited circuit.

https://picasaweb.google.com/112167713973931126525/Mar82011?authkey=Gv1sRgCNf025-ci-2O_QE#5581594051576446434

You've got two R1s.

yes I am using 1K ohm resistors as pullup.
should I change the values? I want HI-LOW out put from these.

No, you still have two resistors labelled R1.
Confusing, isn't it?

https://picasaweb.google.com/112167713973931126525/Mar82011?authkey=Gv1sRgCNf025-ci-2O_QE#5581649302382229970

I have changed it.
the LEDs aint glowing at all. where am I going wrong

OK, but we can't quite see your sketch - if you could maybe just move your head to the side...

int pin3= 0;
int pin5= 0;
int LEDPin8= 0;
int LEDPin11= 0;
int prev1=LOW;
int prev2=LOW;

void setup(){

  // declaration of pin modes
  pinMode(pin3, INPUT);
  digitalWrite(pin3, HIGH);
  pinMode(pin5, INPUT);
  digitalWrite(pin3, LOW);
  pinMode(LEDPin11, OUTPUT);

  pinMode(LEDPin8, OUTPUT);

  // begin sending over serial port
  Serial.begin(9600);
}

void loop(){

  if (pin3 == HIGH) {
    prev1= LOW;
  }

  else {
    prev1 == HIGH;
  }

  pinMode(LEDPin8, prev1);     

  if (pin5 == LOW) 
  {
    prev2= HIGH ;
  }

  else {
    prev2 == LOW;
  }
  pinMode(LEDPin11, prev2);
}
if (pin3 == HIGH) {

It has already been pointed out that 3 != 1.
See also reply #5.

int ledPin = 13;                 // LED connected to digital pin 13

here : digitalWrite() - Arduino Reference

in the above line, pin number is assigned. I am confused!

You're defining the pin number, not the value read from or written to that pin.
You can say "if (pin3 == HIGH)", there's nothing in the language to stop you, but it is futile because, for the foreseable future, the number 3 never will be equal to 1 (aka HIGH).
You need to read the value (state) of the hardware asset represented by "pin3" and not the variable "pin3" itself.

Im guessing this is where you were goin with the code(?):

//Define constants (assigning names to pin numbers; values wont change)
const  int  pin3 = 3;
const  int  pin5 = 5;
const  int  LEDPin8 = 8;
const  int  LEDPin11 = 11;

//Variables (values that will change)
int  pin3var = 0;         //assign variables for pin3 and pin5
int  pin5var = 0;
int  prev1 = LOW;
int  prev2 = LOW;

void setup(){

  // declaration of pin modes
  pinMode(pin3, INPUT);
  pinMode(pin5, INPUT);                //Put the digitalWrites in void loop()
  pinMode(LEDPin11, OUTPUT);
  pinMode(LEDPin8, OUTPUT);

  // begin sending over serial port
  Serial.begin(9600);
}  

void loop(){

digitalWrite(pin3, HIGH);
digitalWrite(pin5, LOW);     //Did you mean to put   digitalWrite(pin3, HIGH);  digitalWrite(pin3, LOW); when it was in the void setup()?
 
 pin3var = digitalRead(pin3);
 pin5var = digitalRead(pin5);

 if (pin3var == HIGH) {
    prev1= LOW;
  }

  else {
    prev1 == HIGH;
  }

  digitalWrite(LEDPin8, prev1);     //digitalWrite LEDpin8 whatever prev1 is. 
                                               //pinMode is for setup that determines if the pin is an input or output

  if (pin5var == LOW) 
  {
    prev2= HIGH ;
  }

  else {
    prev2 == LOW;
  }
  digitalWrite(LEDPin11, prev2);
}