Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people's questions, and connect with other people.

Have an account? Sign In

Captcha Click on image to update the captcha.

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have a permission to ask a question, You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Tech Answered Logo Tech Answered Logo
Sign InSign Up

Tech Answered

Tech Answered Navigation

  • Home
  • Tutorials
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Blog
  • Contact Us
Home / Questions /Q 528
Next
Answered
shiv
shiv

shiv

  • India
  • 31 Questions
  • 9 Answers
  • 0 Best Answers
  • 41 Points
View Profile
  • 0
shiv
Asked: August 28, 20202020-08-28T12:50:03+05:30 2020-08-28T12:50:03+05:30In: Programming Related

What is difference between syntax and semantics of programming language?

  • 0

Is Syntax and semantics different? What is difference between syntax and semantics of programming language?

programming languagesemanticssyntax
  • 2
  • 1,431
  • 0
  • 0
Answer
Share
  • Facebook

    Related Questions

    • which computer language is easy to learn
    • What is the syntax for loop in TCL ?
    • what are the 4 types of programming language?
    • Which is the best programming language to learn right now?
    • Which language should I learn first: JavaScript or PHP?
    • There are large number of programming language available. How to select language for your application?
    • Explain classification of programming language?

    2 Answers

    1. Sweta

      Sweta

      • India
      • 2 Questions
      • 34 Answers
      • 7 Best Answers
      • 138 Points
      View Profile
      Best Answer
      Sweta
      2020-08-29T14:22:17+05:30Added an answer on August 29, 2020 at 2:22 pm

      The syntax of a programming language, broadly speaking, is that set of rules and writing conventions that allow the formation of correct programs in a language, from the point of view of ‘presentation’ only.

      That is, syntax has nothing to do with ‘meaning’ Or run-time behavior of a program.

      Although syntax is concerned only with the form of a program, it is inextricably tied to semantics which is the meaning of the program.

      Usually, semantics is defined in terms of program’s run-time behavior: what happens when the program is executed with a certain set of inputs, what statements are executed, what values are assigned to the variables, and what output is produced.

      • 1
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    2. Ravi Ujjwal
      2020-08-29T18:40:42+05:30Added an answer on August 29, 2020 at 6:40 pm

      Hello,

      Syntax is nothing but a set of strict rules which are never meant to be broken otherwise you’ll encounter errors while semantics is like grammar in other sense you can all it logic. Every statement you write as a code it should define itself, it should give it a meaning. Code will surely work if syntax is correct but semantics is illogical and wrong. Let me demonstrate with examples:

      Here’s a sentence ‘A car’:

      The syntax is correct but the semantics is wrong. Syntax is that A should be used before a consonant sound but at the same time A car doesn’t contain any meaning, it’s illogical.

      Here’s another sentence ‘A car was flying on the road’:

      Syntax is correct as it is in accordance of the grammar but the semantics is wrong because this sentence is logically wrong and is without meaning, as we all know that a car can’t fly. Grammar rules are followed but still meaning less.

      Take another one ‘A car was on the road’:

      Syntax and semantics both are correct as it is grammatically correct and it also gives complete meaning.

      I Hope you are clear with your doubts.

       

      • 2
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    Leave an answer

    Leave an answer
    Cancel reply

    Browse

    Sidebar

    Ask A Question

    More Questions

    • arunraj503

      How to Add, Install SSL Certificate to Your Website

    • EmmaScott

      What are some key considerations when designing a logo for

    • dynamicapps5

      Image Gallery With Animations Using HTML And CSS Code

    • arunraj503

      How to backup android phone to pc before factory reset

    • SEO_BRISK

      What part does content play in SEO, and what impact

    • glenn

      code for matrix multiplication in c

    • sita

      How to add scrolling text in Blogger

    • dynamicapps5

      how to solve error illegal start of expression in java

    Stats

    • Questions 1,991
    • Answers 2,102
    • Posts 12
    • Best Answers 73

    Related Questions

    • kranthi

      which computer language is easy to learn

    • Mingle tap

      What is the syntax for loop in TCL ?

    • dynamicapps5

      what are the 4 types of programming language?

    • harrywilson

      Which is the best programming language to learn right now?

    • Hardik

      Which language should I learn first: JavaScript or PHP?

    • shiv

      There are large number of programming language available. How to select language

    • shiv

      Explain classification of programming language?

    Explore

    • Home
    • Communities
    • Questions
      • New Questions
      • Trending Questions
      • Must read Questions
      • Hot Questions
    • Polls
    • Tags
    • Badges
    • Users
    • Help

    Footer

    Recent Comments

    • muller on how to solve export problem in kinemaster
    • muller on how to solve export problem in kinemaster
    • muller on how to solve export problem in kinemaster
    • AaronBlackburn on why can’t i find my message requests on instagram
    • shree on How to use philips citrus press juicer 25 watts Demo
    Ask A Question

    Archives

    Tags

    laptop buying guide (1) limit google news notifications (1) printer buying guide (1) stop google news notifications (1) turn off google news notifications (1)

    Social media

    © 2023 @ Techanswered.com.
    Terms, Privacy policy & Sitemap.

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.