Explain what is the use of a semicolon (;) at the end of every program statement?



Explain what is the use of a semicolon (;) at the end of every program statement?..

Answer / Anil Kumar Bharti

In C, a semicolon (`;`) at the end of a program statement indicates the end of that statement and allows the compiler to differentiate between statements. Without a semicolon, the compiler might interpret multiple lines as a single statement, leading to syntax errors.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

What is the difference between text and binary i/o?

1 Answers  


A C E G H +B D F A I ------------ E F G H D

1 Answers   Infosys,


What are logical errors and how does it differ from syntax errors?

1 Answers  


a number is perfect if it is equal to the sum of its proper divisor.. 6 is perfect number coz its proper divisors are 1,2 and three.. and 1+2+3=6... a number is deficient if the sum of its proper divisor is less than the number.. sample: 8 is deficient, coz its proper divisors are 1,2 and 4, and 1+2+4=7. abundant number, if the sum of its proper divisor is greater than the number.. sample..12 is abundant coz 1+2+3+4+6=16 which is geater than 12. now write a program that prompts the user for a number, then determines whether the number is perfect,deficient and abundant..

1 Answers  


Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff

1 Answers  


What are terms in math?

1 Answers  


In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.

1 Answers  


main() { int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }

5 Answers   Vector, Vector Solutions,


What is function prototype in c with example?

1 Answers  


wap to print "hello world" without using the main function.

22 Answers   TCS, Wipro,


Write a C++ program to give the number of days in each month according to what the user entered. example: the user enters June the program must count number of days from January up to June

0 Answers  


Explain is it better to bitshift a value than to multiply by 2?

1 Answers  


Categories