When should I declare a function?



When should I declare a function?..

Answer / Atul Prakash

A function should be declared whenever you have a specific task that needs to be repeated multiple times or when the code becomes too complex and difficult to manage. Declaring functions can help make your code more modular, easier to understand, and maintainable.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

how to introdu5ce my self in serco

1 Answers  


c program to subtract between two numbers without using '-' sign and subtract function.

2 Answers  


What is call by value in c?

1 Answers  


how can write all 1to 100 prime numbers using for loop,if and break ?

2 Answers   TCS,


Explain what does the function toupper() do?

1 Answers  


Differentiate between functions getch() and getche().

1 Answers  


what does the following code do? fn(int n,int p,int r) { static int a=p; switch(n){ case 4:a+=a*r; case 3:a+=a*r; case 2:a+=a*r; case 1:a+=a*r; } } a.computes simple interest for one year b.computes amount on compound interest for 1 to 4 years c.computes simple interest for four year d.computes compound interst for 1 year

7 Answers   TCS,


Write a program of prime number using recursion.

1 Answers   Aspiring Minds,


Which header file is essential for using strcmp function?

1 Answers  


while initialization of array why we use a[][2] why not a[2][]...?

1 Answers   Aptech,


What is double pointer?

1 Answers  


what is real time system?what is the differance between hard and soft real time systems

2 Answers  


Categories