0 votes
372 views
in C program by (98.9k points)
edited

Can the curly brackets { } be used to enclose a single line of code?

1 Answer

0 votes
by (98.9k points)
selected by
 
Best answer
While curly brackets are mainly used to group several lines of codes, it will still work without error if you used it for a single line. Some programmers prefer this method as a way of organizing codes to make it look clearer, especially in conditional statements.

Related questions

0 votes
1 answer 768 views
+1 vote
1 answer 363 views
0 votes
1 answer 517 views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

Recent Badges

Doubtly Earned a badge
Doubtly Earned a badge
Doubtly Earned a badge

5.7k questions

5.1k answers

108 comments

648 users

...