Showing posts with label C Programmer. Show all posts
Showing posts with label C Programmer. Show all posts

Friday, February 11, 2011

5 quizzes about C language! Take the challenge!

Hey, guys, here are 5 quiz about C language, normally 90% of people that take the quiz beblow can only get 4 of them right. Out of another 10%, there are only less than 5% can get them all right. Take the challenge and see if you can get them all right. Good luck.

1.  The core function in every C language program is called
A. numero_uno().
B. main().
C. primus().
D. core().


2.  C language keywords are
A. The “words” of the C language.
B. Held together with string and earwax.
C. Uttered only in candlelit reverence by the C Language Gurus.
D. As numerous as the stars and nearly as distant.


3.  In addition to keywords are
A. Functions, such as printf().
B. Operators, such as +, -, and other weird things.
C. Curly braces or brackets, angle brackets — all sorts of brackets. Man, do we have a bracket problem!
D. Probably all of the above.


4.  Functions require parentheses because
A. They talk in whispers.
B. The parentheses keep the function warm.
C. The parentheses hold various things required by or belonging to the function.
D. What’s a function?


5.  A telltale sign of any C program is its curly braces. Using what you know of
C, draw in the braces where they should appear in the following program:
int main()
printf(“Goodbye, cruel world!\n”);
return(0);

I will give the answers in later post of this blog. So keep an eye on this blog.

Passage reproduced from:http://clanguage86.blog.co.in/2011/02/11/5-quizzes-about-c-language-take-the-challenge/

See also:

What to do when you come across an error?

The autopsy Part1

The autopsy Part2

Sponsor:DVD Ripper

Thursday, January 20, 2011

The Four Steps to build a C program

Four steps are required in order to build any program in C. They are save, com­pile, link, and run. Most C programming language packages automatically per­form the linking step, though whether or not it’s done manually, it’s still in there.

Save! Saving means to save your source code. You create that source code in a text editor and save it as a text file with the C (single letter C) extension.

Compile and link! Compiling is the process of transforming the instructions in the text file into instructions the computer’s microprocessor can under­stand. The linking step is where the instructions are finally transformed into a program file. (Again, your compiler may do this step automatically.)

Run! Finally, you run the program you have created. Yes, it’s a legitimate pro­gram, like any other on your hard drive. You have completed all these steps in this chapter, culminating in the cre­ation of the GOODBYE program. That’s how C programs are built. At this stage, the hardest part is knowing what to put in the source file, which gets easier as you progress through this book. (But by then, getting your program
to run correctly and without errors is the hardest part!)

You find the instructions to save, compile, and run often in this book. That’s because these steps are more or less mechanical. What’s more important is understanding how the language works. That’s what you start to find out about in the next chapter.

Welcome to reproduce this passage. Please indicate the source when you reproduce this passage.

Sunday, January 16, 2011

Extra help in typing the GOODBYE.C source code

The first line looks like this:
#include <stdio.h>

Type  a  pound  sign  (press  Shift+#)  and  then include and a space. Type a left angle bracket (it’s  above  the  comma  key)  and  then stdio, a
period, h, and a right angle bracket. Everything must  be  in  lowercase  —  no  capitals!  Press Enter to end this line and start the second line.

Press the Enter key alone on the second line to make it blank. Blank lines are common in pro­gramming code; they add space that separates
pieces of the code and makes it more readable. And, trust me, anything that makes program­ming code more readable is okay by me!

Rip DVD to avi, watch it on computer and store it on your phone, share it to your friend.   dvd-to-avi-convertor.com
Convert dvd to mp3. Watch your movie by your hand. Enjoy it everywhere.  convertDVDtoMp3.com
Convert dvd to mp4. Show it to everybody. Attract eyeballs.  dvds-to-mp4.com
                                                                                                                            PaidMini

Type the word int, a space, a main, and then two parentheses hugging nothing:

int main()

There  is  no  space  between  main and  the parentheses and no space inside the parenthe­ses. Press Enter to start the fourth line.

Type a left curly brace:

{

This character is on a line by itself, right at the start of the line. Press Enter to start the fifth line.

printf(“Goodbye, cruel
world!\n”);

If your editor was smart enough to automati­cally indent this line, great. If not, press the Tab key to indent. Then type printf, the word print with a little fat then end, (It’s pronounced “print­eff.”)  Type  a  left  parenthesis.  Type  a  double quote. Type Goodbye, cruel world, followed by
an exclamation point. Then type a backslash, a little n, double quotes, a right parenthesis, and, finally, a semicolon. Press Enter to start the sixth ine.
return(0);

If  the  editor  doesn’t  automatically  indent  the sixth line, press the Tab key to start the line with an indent. Then type return, a paren, 0 (zero), a paren, and a semicolon. Press Enter.

On the seventh line, type the right curly brace:
}
Some editors automatically unindent this brace for you. If not, use your editor to back up the brace so that it’s in the first column. Press the Enter key to end this line.

Leave the eighth line blank.

Welcome to reproduce this passage. Please indicate the source when you reproduce this passage.
Source: C Language

The compiler and the linker

Paid Recommendations: Convert DVD To AVI . Rip the DVD movie to your computer, protect your DVD. Convert DVD to mp3. Convert DVD to mp4
Find out more at 
http://www.daniusoft.com/dvd-ripper.html

After the source code is created and saved to disk, it must be translated into a language the computer can understand. This job is tackled by the compiler.

The compiler is a special program that reads the instructions stored in the source code file, examines each instruction, and then translates the information into the machine code understood only by the computer’s microprocessor. If all goes well and the compiler is duly pleased with your source code, the compiler creates an object code file. It’s a middle step, one that isn’t necessary for smaller programs but that becomes vital for larger programs.


Finally, the compiler links the object code file, which creates a real, live com­puter program.


If either the compiler or the linker doesn’t understand something, an error message is displayed. At that point, you can gnash your teeth and sit and stew.

Then go back and edit the source code file again, fixing whatever error the compiler found. (It isn’t as tough as it sounds.) Then you attempt to compile the program again — you recompile and relink.

1 The compiler translates the information in the source code file into instruc­tions the computer can understand. The linker then converts that infor­mation into a runnable program. 
2 The GCC compiler recommended and used in this book combines the compiling and linking steps. An object file is created by GCC, but it is
automatically deleted when the final program file is created.
3 Object code files end in OBJ or sometimes just O. The first part of the object file name is the same as the source code filename.
4 Feel free to cheerfully forget all this object code nonsense for now. 
5 Text editor➪Compiler.
6 Source code➪Program.

Welcome to reproduce this passage. Please indicate the source when you reproduce this passage.
Source: C Language 

Sunday, January 9, 2011

The C Development Cycle and the C Programmer

Use DVD Ripper To Rip Your DVD. Transfer your DVD to your computer. Keep it save.
Convert dvd to ipad. Watch your movie by your hand. Enjoy it everywhere.
Convert dvd to iphone. Show it to everybody. Attract the eyeballs.
                                                                                                                            Sponsor

Here is how you create a C program in seven steps — in what’s known as the development cycle:
1.  Come up with an idea for a program.
2.  Use an editor to write the source code.
3.  Compile the source code and link the program by using the C compiler.
4.  Weep bitterly over errors (optional).
5.  Run the program and test it.
6.  Pull out hair over bugs (optional).
7.  Start over (required).
No need to memorize this list. It’s like the instructions on a shampoo bottle, though you don’t have to be naked and wet to program a computer. Eventually, just like shampooing, you start following these steps without thinking about it. No need to memorize anything.
The C development cycle is not an exercise device. In fact, program­ming does more to make your butt fit more snugly into your chair than
anything.
Step 1 is the hardest. The rest fall naturally into place.
Step 3 consists of two steps: compiling and linking.

When you create a program, you become a programmer. Your friends or rela­tives may refer to you as a “computer wizard” or “guru,” but trust me when I say that programmer is a far better title.

As a programmer, you job is not “programming.” No, the act of writing a pro­gram is coding. So what you do when you sit down to write that program is code the program. Get used to that term! It’s very trendy.


The job of the programmer is to write some code! Code to do what? And what type of code do you use? Secret code? Morse Code? Zip code?
The purpose of a computer program is to make the computer do something.
The object of programming is to “make it happen.” The C language is only a tool for communicating with the PC. As the programmer, it’s your job to trans­late the intentions of the computer user into something the computer under­stands and then give users what they want. And if you can’t give them what they want, at least make it close enough so that they don’t constantly com­plain or — worse — want their money back.


The tool you have chosen to make it happen is the C programming language. That’s the code you use to communicate with the PC. The following sections describe how the process works. After all, you can just pick up the mouse and say “Hello, computer!”
Programming is what TV network executives do. Computer programmers code.
You use a programming language to communicate with the computer, telling it exactly what to do.

Welcome to reproduce this passage. Please indicate the source when you reproduce this passage.