What is the best way of making my program efficient?



What is the best way of making my program efficient?..

Answer / Moneeka

In C, there are several ways to improve the efficiency of your program. Here are a few suggestions:
1. Use efficient data structures like arrays, linked lists, and hash tables instead of dynamic memory allocation whenever possible.
2. Avoid unnecessary function calls and calculations.
3. Use preprocessor directives for conditional compilation if parts of your code are not required in certain environments or build configurations.
4. Optimize loops by using techniques like loop unrolling, pipelining, and vectorization where applicable.
5. Properly manage memory allocation to avoid memory leaks and fragmentation.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

what is the main use of c where it can use the c

2 Answers   Infosys,


Why pointers are used?

1 Answers  


How do you generate random numbers in C?

1 Answers  


3.write a simple program that will output your name,phone number,e-mail address,and academic major on separate lines 1.create an account and a personal directory for your work b.find out how to create a subdirectory on your system.create one called info c.you will use a text editor to type in your programs and data files.some C systems have a built in text editor;others do not.Find out what text editor you will be using and how to access it.create a text file(not a program) containing your name ,address,and telephone number on separate lines.Next,write the brand of computer you are using and the name of the text editor.Then write a paragraph that describes your past experience with computers.save this file in your info directory. d. find out how to print a file on your system .print out and turn in the file you created in (c).

0 Answers   TCS,


What is difference between class and structure?

1 Answers  


Explain what are multidimensional arrays?

1 Answers  


Why structure is used in c?

1 Answers  


What is the purpose of macro in C language?

1 Answers   Fidelity,


what is the difference between. system call and library function?

2 Answers   CDAC, Satyam,


What is identifiers in c with examples?

1 Answers  


What are static variables, and where are they stored?

2 Answers  


What is adt in c programming?

1 Answers  


Categories