The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+13 votes
1.3k views

The C language is:

  1. A context free language
  2. A context sensitive language
  3. A regular language
  4. Parsable fully only by a Turing machine
asked in Programming by Veteran (68.8k points) | 1.3k views

3 Answers

+23 votes
Best answer

Answer (B)

All modern programming languages are CSL. Because they contain two features which cannot be handled by PDA.

The features are:

  • variable declared before use and
  • matching formal and actual parameters of functions.
answered by Veteran (13.3k points)
edited ago by
+12 votes
answered by Veteran (35.9k points)
Reference link is not working.

I found C is a CFG language.

http://poj.org/problem?id=3220
@Arjun sir, According to the accepted answer of  http://stackoverflow.com/questions/14589346/is-c-context-free-or-context-sensitive  the answer should be D too ??
that is telling about C++ and reason being templates. C grammar should be context sensitive..

@Arjun SIR
What about JAVA  and Python ?  How to answwer this kind of questions ? :(

–2 votes
ans b)
answered by Boss (5.1k points)


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

32,470 questions
39,199 answers
109,000 comments
36,575 users