Program 61 #P61 - C Program Prime Number Program with Argument passed and a return value #C180

Subscribers:
10,700
Published on ● Video Link: https://www.youtube.com/watch?v=BWyulrzhGR4



Duration: 3:17
205 views
12


The input from the user is passed to checkPrimeNumber() function.

The checkPrimeNumber() function checks whether the passed argument is prime or not. If the passed argument is a prime number, the function returns 0. If the passed argument is a non-prime number, the function returns 1. The return value is assigned to the flag variable.

Depending on whether flag is 0 or 1, appropriate message is printed from the main() function.

Which approach is better?
Well, it depends on the problem you are trying to solve. In this case, passing argument and returning a value from the function (example 4) is better.

A function should perform a specific task. The checkPrimeNumber() function doesn't take input from the user nor it displays the appropriate message. It only checks whether a number is prime or not, which makes code your code easy to understand and debug.

#rubalsolutions #coding #developer #programming #programmer #technology #clanguage #computerscience #c #informaticpractices #sub #subscribe #youtube #newyoutuber #youtubechannel




Other Videos By Rubal Solutions


2019-03-25Theory - Learning C Programming || Recursive Function In C Programming. || For Beginners || #C186
2019-03-25Program 66 #P66 - C Program to Print "Hello World" WITHOUT using semi colon. #C185
2019-03-24Program 65 #P65 - C Program FOR FUNCTION (USING CALL BY REFERENCE)#C184
2019-03-24Program 64 #P64 - C Program FOR C FUNCTION (USING CALL BY VALUE)#C183
2019-03-24Program 63 #P63 - C Program to to find Square of a Number Using User-defined Function #C182
2019-03-23A Small Story - Worth Narrating !! Important keys for a healthy, growing, and lasting relationship.
2019-03-23आज की कथा - शनिवार की कथा || शनिवार व्रत कथा || #कथा08
2019-03-22आज की कथा - गणगौर की पौराणिक कथा || Gangaur Festival || Gangaur Ki Kahani || गणगौर की कथा || #कथा07
2019-03-21Program 62 #P62 - C Program to Check Prime or Armstrong Number Using User-defined Function #C181
2019-03-20Holi Ki Ram Ram. होलिका दहन ।। होली की शुभकामनाये सबको ।। अपनी अपनी blessings देते रहना channel ko .
2019-03-20Program 61 #P61 - C Program Prime Number Program with Argument passed and a return value #C180
2019-03-20Program 60 #P60 - C Program Prime Number Program Argument passed but no return value #C179
2019-03-20Program 59 #P59 - C Program PPrime Number Program with No arguments passed but a return value #C178
2019-03-20होलिका दहन की कहानी - मुदित को जो समझ आया उसने अपने शब्दों में दाल दिए ।। thank u betuuuuu 😇😇🌟🌟
2019-03-19आज की कथा - गणेशजी (विनायक जी की कहानी ) #कथा06
2019-03-19Beautiful Stone Art By Artist ... Stone Art is awesome ...
2019-03-19A Story Worth Sharing - Busy But Be-Easy हर पल को खुश होकर जियो || सदा स्वस्थ रहो ||
2019-03-18Program 58 #P58 - C Program Prime No By User Defined Function No arguments and no return Value #C177
2019-03-16Some important Common Full Forms To Be Known for Various Competitive Exams.
2019-03-16Program 57 #P57 - C Program to add two number's using a UserDefined Function #C176
2019-03-15Theory - Learning C Programming ||Some Imp Points About Functions In C. || For Beginners || #C175



Tags:
computer education
computer education in Hindi
basic computer training
rubalsolutions
beginner YouTube
coding
developer
newyoutuber
subscribe
sub
computer-science
function definition
#functions
#loops
#statements
#programs
#detailedprogramming
#learn c
#youtube rocks
#userdefined
#library functions
#twotypesoffunctions
c language
practical use of c programming
computer educational videos
importance of computer education in hindi
#arguments
#prime number
#user defined