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

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

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

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

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

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8025789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:16:42+00:00 2026-06-04T23:16:42+00:00

In C I can do the following: int main() { printf(HELLO WORLD);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; } and

  • 0

In C I can do the following:

int main()
{
 printf("HELLO WORLD");;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
}

and it works! Why is that?

My personal idea: semicolons are a NO OPERATION (from Wikipedia) indicator, having a giant string of them serves the same idea as having one and telling C that a statement has ended.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T23:16:44+00:00Added an answer on June 4, 2026 at 11:16 pm

    A semicolon terminates a statement… consecutive semicolons represent no-operation statements (as you say). Consider:

    while (x[i++] = y[j++])
        ;
    

    Here, all the work is done in the loop test condition, so an empty statement is desirable. But, empty statements are allowed even when there is no controlling loop.

    Why?

    Well, many uses of the preprocessor may expand to some actual C code, or be removed, based on some earlier defines, but given…

     MY_MACRO1();
     MY_MACRO2();
    

    …the preprocessor can only replace the MY_MACROX() text, leaving the trailing semicolons there, possibly after an empty statement. If the compiler rejected this it would be much harder to use the preprocessor, or the preprocessor calls would be less like non-preprocessor function calls (they’d have to output semicolons within the substitution, and the caller would have to avoid a trailing semicolon when using them) – which would make it harder for the implementation to seemlessly substitute clever macros for functions for performance, debugging and customisation purposes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say we have the following code: int main(){ int a[3]={1,2,3}; printf( E: 0x%x\n, a);
I'm trying to print a string the following way: int main(){ string s(bla); printf(%s
How can the following simple implementation of sum be faster? private long sum( int
With a vector, I can do the following: vector<int> myvec (4,100); int first =
How can I rewrite he following code using C#3.0 automatic properties? private int _myValue;
Consider the following example: struct MyStruct { int a; int b; }; I can
can we declare a function in a header file in following way? extern int
Can I assign a pointer to an integer variable? Like the following. int *pointer;
I am using following c code #include <fcgi_stdio.h> /* * */ int main(int argc,
just for testing i had created the following code: #include<stdio.h> int main(){ char *p

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

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.