12th (ਕੰਪਿਊਟਰ ਸਾਇੰਸ/Computer Science) - 2026-27

ਪਾਠ-2/Chapter-2
User Defined Functions/User Defined Functions





Q-1.
ਸੀ ਵਿਚ ਪ੍ਰੋਗਰਾਮ ਇਨ੍ਹਾਂ ਵਿੱਚੋ ਕਿਸ ਨਾਲ ਸ਼ੁਰੂ ਹੁੰਦਾ ਹੈ ?
With which of these programs does the program begin in C?
Q-1. Objective  

1) ਫੰਕਸ਼ਨ ਜਿਹੜਾ ਪਹਿਲਾ ਪਰਿਭਾਸ਼ਤ ਕੀਤਾ ਗਿਆ /The function that was first defined
2) main() ਫੰਕਸ਼ਨ /main() function
3) ਫੰਕਸ਼ਨ ਜਿਹੜਾ ਅੰਤ ਵਿਚ ਪਰਿਭਾਸ਼ਤ ਕੀਤਾ ਗਿਆ/The function that was eventually defined
4) Main() ਤੋਂ ਇਲਾਵਾ ਫੰਕਸ਼ਨ/Function other than man()

Ans.) main() ਫੰਕਸ਼ਨ /main() function

Q-2.
ਇਕ ਫੰਕਸ਼ਨ (function) ਜਿਸ ਦੀ ਕੋਈ ਕਾਰਵਾਈ ਨਹੀਂ ਹੁੰਦੀ ?
A function that is no action?
Q-2. Objective  

1) ਇਕ ਅਵੈਧ ਫੰਕਸ਼ਨ ਹੁੰਦਾ ਹੈ /There is an invalid function
2) ਵਾਕ ਰਚਨਾ ਗ਼ਲਤੀ (syntax error) ਪੈਦਾ ਕਰਦਾ ਹੋ /If create a syntax error
3) ਆਗਿਆ ਦਿਤੀ ਜਾਂਦੀ ਹੈ ਅਤੇ ਇਸਨੂੰ ਡੰਮੀ ਫੰਕਸ਼ਨ ਕਿਹਾ ਜਾਂਦਾ ਹੈ /Is allowed and is called a dummy function
4) ਜ਼ੀਰੋ ਵਾਪਸ ਕਰਦਾ ਹੈ।/Returns zero.

Ans.) ਆਗਿਆ ਦਿਤੀ ਜਾਂਦੀ ਹੈ ਅਤੇ ਇਸਨੂੰ ਡੰਮੀ ਫੰਕਸ਼ਨ ਕਿਹਾ ਜਾਂਦਾ ਹੈ /Is allowed and is called a dummy function

Q-3.
ਫੰਕਸ਼ਨ (function) ਵਿਚ ਮੁਢਲੀ ਡਾਟਾ ਟਾਈਪ ਹੁੰਦੀ ਹੈ ?
What is the basic data type in a function?
Q-3. Objective  

1) /void
2) /int
3) /float
4) /char

Ans.) /int

Q-4.
ਸੀ ਵਿਚ ਪੈਰਾਮੀਟਰ ਪਾਸਿੰਗ (passing) ਯੰਤਰੀਕਰਨ (Mechanism) ਕੀ ਹੁੰਦਾ ਹੈ ?
What is the mechanism passing in C?
Q-4. Objective  

1) /call by name
2) /call by value
3) /name call
4) /None of these

Ans.) /call by value

Q-5.
ਇਨ੍ਹਾਂ ਵਿੱਚੋ ਮੇਨ ਫੰਕਸ਼ਨ (Main Function) ਕਿਹੜਾ ਹੈ ?
Which of these is the main function?
Q-5. Objective  

1) /a built-in function
2) /a user define function
3) /optional
4) /all of these

Ans.) /a user define function

Q-6.
ਕੀ ਹਰ ਫੰਕਸ਼ਨ (Function) ਦੇ ਵਿਚ ਇਕ ਰਿਟਰਨ ਸਟੇਟਮੈਂਟ (return statement) ਹੋਣੀ ਜਰੂਰੀ ਹੁੰਦੀ ਹੈ ?
Does every function have to have a return statement?
Q-1. True/False  

1) ਸਹੀ/True
2) ਗਲਤ/False

Ans.) ਗਲਤ/False

Q-7.
ਇਕ ਫੰਕਸ਼ਨ ਦੇ ਵਿਚ ਇਕ ਤੋਂ ਵੱਧ ਰਿਟਰਨ ਸਟੇਟਮੈਂਟ (return statement) ਹੋ ਸਕਦੀਆਂ ਹਨ ?
Can there be more than one return statement in a function?
Q-2. True/False  

1) ਸਹੀ/True
2) ਗਲਤ/False

Ans.) ਸਹੀ/True

Q-8.
ਕੀ ਅਸੀਂ ਕਾਂਸਟੇਂਟ ਨੂੰ ਫੰਕਸ਼ਨ ਵਿਚ ਪਾਸਡ (passed) ਕਰ ਸਕਦੇ ਹਾਂ ?
Can we pass the Constant to a function?
Q-3. True/False  

1) ਸਹੀ/True
2) ਗਲਤ/False

Ans.) ਸਹੀ/True

Q-9.
ਫੰਕਸ਼ਨ (Function) ਇਕ ਤੋਂ ਵਧੇਰੇ ਮੁੱਲ ਵਾਪਸ ਭੇਜਦਾ ਹੋ ਜੋ ਕਿ ਵਾਪਸ ਵਿਵਰਣ ਵਰਤਣਾ ਚਾਹੀਦਾ ਹੈ ?
Returns more than one value of a function that should use a return statement?
Q-4. True/False  

1) ਸਹੀ/True
2) ਗਲਤ/False

Ans.) ਗਲਤ/False

Q-10.
ਇਕ ਫੰਕਸ਼ਨ (function) ਤੋਂ ਵਾਪਸ ਮੁੜਨ ਲਈ ਤੁਹਾਨੂੰ ਇਕ ਫੰਕਸ਼ਨ ਵਿਚ ਵਾਪਸ ਵਿਵਰਣ ਵਰਤਣਾ ਚਾਹੀਦਾ ਹੈ ?
To return from a function should you use the statement return in a function?
Q-5. True/False  

1) ਸਹੀ/True
2) ਗਲਤ/False

Ans.) ਸਹੀ/True