UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Is it necessary to return 0 in a program? Why?

Asked by Last Modified  

Follow 5
Answer

Please enter your answer

Professional with 10+ years of experience. Expert in teaching C, Java, Python, Data Structures

It is good to return 0 , as 0 means TRUE for the operating system. Values other than 0 will have some other meaning in the operating system perspective. When we are returning 0, it is an indication that program completed successfully. In case of abnormal termination, You will be notified with different...
read more
It is good to return 0 , as 0 means TRUE for the operating system. Values other than 0 will have some other meaning in the operating system perspective. When we are returning 0, it is an indication that program completed successfully. In case of abnormal termination, You will be notified with different values, which has specific meaning. For example pressing Ctrl-C in the middle of the program will return 130. read less
Comments

Tutor

It depends, It depends on your method data type, for suppose you have created a method type as void so you don't need to return, but for suppose you have created a method as int or string or any data type then you have to return the value.
Comments

Computer Wizard

if function has return type then return 0 otherwise not matter
Comments

Software Architect

Its always considered as a healthy programming to return something from your program. Advantages: You can control what kind of message you want to return if your program fails and what kind of message you want to return if your program passes. I guess you question is in context of main method. That...
read more
Its always considered as a healthy programming to return something from your program. Advantages: You can control what kind of message you want to return if your program fails and what kind of message you want to return if your program passes. I guess you question is in context of main method. That method is invoked by OS whenever you run the program, so it will be good if OS knows weather your program passed or failed. read less
Comments

View 2 more Answers

Related Questions

How do I send a C program via email?
By using Google drive
Furqankhan
0 0
5
Why is C still so popular?
C remains popular for several reasons, and its enduring popularity can be attributed to a combination of historical significance, efficiency, and versatility. Here are some key reasons why C is still widely...
A
0 0
6
How do I write a C program to print the total number of a single-digit prime number using a loop?
total number of single digit prime number that means your prime number starts from 2 and less than 9 so you can take loop for this range
Momin
0 0
7
What is #line used for?
# is a preprocessor directive. so it is used in the c program by two way. 1. such as #include stdio.h In this line to read all the library function of stdio.h before processing the program. 2. # define...
Pradeep

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Pointers Concept
Every variable has a memory location and every memory location has its address defined which can be accessed using ampersand (&) operator, which denotes an address in memory. Consider the following...

Storage classes in c
Storage classes determine the scope and life time of a variable. Scope is defined as the region over which the defined variable is accessible. Lifetime is the time during which the value of a variable...

An Interesting discussion about malloc( ) and calloc( )
What are malloc( ) and calloc( )? Simply putting they are the predefined functions in C language. Malloc( ) and calloc( ) are two such functions which are used for more or less identical purpose and...

INTRODUCTION TO PROGRAMMING LANGUAGES
Language is a medium for communication. If we want to perform anything with another person, we can know the human language as a human being. Similarly, if we want to perform anything with a computer, we...

C Language
To get help in C window (for keywords, functions) press Alt +F1.To delete a single line , use the shortcut key CTRL +Y.If you got error about the path when you execute a C pgm, check the Options menu =>Directories.
T

Thilagam S.

0 0
0

Recommended Articles

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...

Read full article >

Applications engineering is a hot trend in the current IT market.  An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more