answersLogoWhite

0


Best Answer

Here is a simple program that will tell you how to make an algorithm:

int main();

{

int length;

int width;

int total;

printf("What is the width: ");

scanf("%d", &width);

printf("What is the length: ");

scanf("%d", &length);

total = width * 2 + 2 * length; /*Here is the algorithm for finding the perimeter of a square*/

printf("The perimeter is: %d", total);

return 0;

}

Output:

What is the width: 32

What is the length: 55

The perimeter is: 174

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

Function-header, consisting of return type, name of function, parameter.

Function-body, consisting of statements enclosed in curly braces {}.

Simple example:

#include /*Function-call*/

void main(void) /*Function-header*/

{

printf("Hello world!"); /*Function-body and statements start here*/

}

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

C Programming language is already defined, you don't have to do anything with it.

You could write a C-compiler, if your were much more experienced than you are now.

Or you can write a program in C, I give you an example:

#include

int main (void)

{ puts ("Hello, world!"); return 0; }

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

An algorithm is simply a description of the logical step-by-step procedure required to solve a particular problem. You do not write algorithms in C (or indeed in any programming language) you write them in your native language (such as English). Algorithms that employ loops or conditional expressions are typically presented using a flowchart to better visualise the implementation of complex algorithms, however all complex problems can be broken down into a sequence of much simpler problems each of which has its own algorithm. When presenting algorithms to programmers from various backgrounds, pseudo-code is used to provide a language-agnostic version of the implementation that can easily be translated into any language but, ultimately, it is the programmer's responsibility to translate algorithms into functional code. But first you have to write the algorithm. Ignore the language and concentrate on the problem itself. Describe how the problem should be solved, then write the code to implement your solution.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

No-one can answer a question like that here!

For a start you've not told us what you want the programme to do: complex word-processing, heavy mathematics, process-control, high-speed graphics...?

The most anyone could do here is answer specific queries about particular commands, routines or errors that have baffled you.

Even introductory books on C++, or any other language, are hefty tomes.

You can only learn effective computer programming on a formal course, unless your aptitude and previous experience is sufficient to allow you to pick it up from a text-book, worked examples and a heck of a lot of practice.

This answer is:
User Avatar

User Avatar

Wiki User

7y ago

You can write a C++ program using nothing more than notepad, however a C++ editor is easier to work with. However, to execute the program, you will also need a C++ compiler and linker. A C++ integrated development environment (IDE) will provide all the tools you need to get started.

This answer is:
User Avatar

User Avatar

Wiki User

8y ago

You will need to first know a C language such as C# or C++. You will then need a compiler that takes what you write and turns it into a running program.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

Pseudo-code an C-source are different things, don't try to mix them.

This answer is:
User Avatar

User Avatar

Wiki User

16y ago

Its not a single line question.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How to write an effective program using c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you write a C plus plus program that displays a pyramid of Xes on the screen using a for loop?

printf ("x")


How do you write a program in C plus plus plus plus How do you write a program in C to swap two variables without using the third oneo swap two variables without using the third one?

To swap two variables without using a third variable, use exclusive or manipulation... a ^= b; b ^= a; a ^= b;


Would you Write c plus plus program using array for Fibonacci number?

You can write a C++ fib pro using arrays but the problem is the prog becomes very complicated since u need to pass the next adding value in an array.....


How do you write a programm in c plus plus without using function main?

I don't think its possible. Every C++ program must at least have the main function.


A program c plus plus on automorphic numbers or not?

how to write a program that counts automorphic number from 1 to 999


What is the importance of functions in a c plus plus program?

Functions are very important in C++, as you can't write the simplest program to print hello without using a function. Overall you can say that function are building blocks of a C++ program. Functions can also be defined by the programmer to reduce program size.


How do you write a C plus plus program that will display the first 10 positive prime numbers?

By learning how to program on C+.


Write a program in c plus plus to implement macro processor?

Don't write, it is already written, google for 'cpp'.


How do you write program to convert meter to kilometer in c plus plus?

Divide it by 1000.


Do I need to write a program to find a substring in a given string in c plus plus?

No.


How do you design a computer using c plus plus?

C++ is used to write programs, not to design computers. If you want to design computers, use a CAD program specifically intended to aid in electronics design.


How do you write an Algorithm for a C plus plus Program?

You don't write an algorithm for a C++ program, unless you are documenting the C++ program after-the-fact. The normal procedure is to write the algorithm first, in a language independent fashion, and then translate that stated algorithm into C++ code, or into whatever language you wish.