mockers
Would you like to react to this message? Create an account in a few clicks or log in to continue.

NESTED INDENTATION:Bansal Sir

4 posters

Go down

NESTED INDENTATION:Bansal Sir Empty NESTED INDENTATION:Bansal Sir

Post  ballu Sun Feb 01, 2009 10:07 pm

Write a code to check whether the compiler supports nested indenntation??
ballu
ballu

Posts : 58
Join date : 2009-02-01

Back to top Go down

NESTED INDENTATION:Bansal Sir Empty Re: NESTED INDENTATION:Bansal Sir

Post  Admin Wed Feb 04, 2009 2:51 am

sorry what is a nested indentation??
please give an example.

Admin
Admin

Posts : 47
Join date : 2009-01-29

https://mockers.forumotion.com

Back to top Go down

NESTED INDENTATION:Bansal Sir Empty Re: NESTED INDENTATION:Bansal Sir

Post  Beagle Wed Feb 04, 2009 3:27 am

example of a python script...

import sys


'''This module returns a list of primes till an integer n'''
def get_primes(n):
......primes=[]
......sieve = range(2,n+1)
___
___while len(sieve):
_________a = sieve.pop(0)
_________sieve = filter(lambda i : (i%a!=0), sieve)
_________primes.append(a)

___print primes

if __name__=='__main__' :
_____if len(sys.argv) == 2:
_________n = int(sys.argv[1])
_____else :
_________print "Using default value of 32"
_________n = 32
_____get_primes(n)

Beagle

Posts : 40
Join date : 2009-01-30

Back to top Go down

NESTED INDENTATION:Bansal Sir Empty Re: NESTED INDENTATION:Bansal Sir

Post  Admin Wed Feb 04, 2009 10:41 am

do u mean to say as an alternative to {} in c/c++??

then try this code

Code:

#include<iostream>
using namespace std;

int main()
{
int i = 1;
if(false)
        i=0;//dummy, since we know it wont run anyway
        i--;

cout<<"indentation: boolean value = "<<i;

cin>>i;
}

well it will definitely fail for c++,but i think u are getting the idea.

Admin
Admin

Posts : 47
Join date : 2009-01-29

https://mockers.forumotion.com

Back to top Go down

NESTED INDENTATION:Bansal Sir Empty Re: NESTED INDENTATION:Bansal Sir

Post  mnnit.rahul Thu Feb 05, 2009 10:52 am

kya bol rahe ho bhaiya sab upar se ja raha hai nestes indentataion ka maaatlab kya hai??

mnnit.rahul

Posts : 51
Join date : 2009-02-01

Back to top Go down

NESTED INDENTATION:Bansal Sir Empty @everyone

Post  ballu Fri Feb 06, 2009 9:26 pm

abe it means
does your compiler recognisez this type of syntax
/*
/*
*/
*/
ballu
ballu

Posts : 58
Join date : 2009-02-01

Back to top Go down

NESTED INDENTATION:Bansal Sir Empty Re: NESTED INDENTATION:Bansal Sir

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum