473,327 Members | 2,025 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Online C Programming Quizzes

My site is home to series of quizzes ranging from Accounting,
Business, Math to programming languages. These are multiple choice
type questions and you get a score card at end.

For C language, I have 3 set of quizzes that anyone is welcome to try
online for free.
Questions on C quizzes are rather easy to solve for Professional C
programmers yet for those who are taking C as a first programming
course will find these useful in assesment their C
knowledge
Visit http://www.thinkanddone.com/exams/main.aspx
Regards
Asad S. Yousaf

Oct 6 '07 #1
23 3593
On Sat, 06 Oct 2007 00:22:53 -0700, Dexter wrote:
My site is home to series of quizzes ranging from Accounting,
Business, Math to programming languages. These are multiple choice
type questions and you get a score card at end.

For C language, I have 3 set of quizzes that anyone is welcome to try
online for free.
Questions on C quizzes are rather easy to solve for Professional C
programmers yet for those who are taking C as a first programming
course will find these useful in assesment their C
knowledge
Visit http://www.thinkanddone.com/exams/main.aspx
I found something wrong already at the first level.
Question 3 is:
3 . Its given that variable x has been assigned a value of 5, which of the following statement will output the message "I am quite right"
if (x!=5) printf("I am quite right");
if (x=5) printf("I am quite right");
both statements will display the message
none of the above
The second statement will assign 5 to x (which happens to already
have that value, but that's irrelevant) and, since the result of
that assignment can never be zero, it will execute the expression
statement consisting of the printf call. So I checked the second
answer, but the test believes the correct answer to be "none of
the above".

--
Army1987 (Replace "NOSPAM" with "email")
A hamburger is better than nothing.
Nothing is better than eternal happiness.
Therefore, a hamburger is better than eternal happiness.

Oct 6 '07 #2
On Oct 6, 5:22 pm, Dexter <yousaf.a...@gmail.comwrote:
My site is home to series of quizzes ranging from Accounting,
Business, Math to programming languages. These are multiple choice
type questions and you get a score card at end.

For C language, I have 3 set of quizzes that anyone is welcome to try
online for free.
Questions on C quizzes are rather easy to solve for Professional C
programmers yet for those who are taking C as a first programming
course will find these useful in assesment their C
knowledge

Visithttp://www.thinkanddone.com/exams/main.aspx

Regards

Asad S. Yousaf
Some of the questions could be better worded, and some of the
questions are just plain wrong.

--------------
Dataset 1
--------------

Question 1 states: A C program is a collection of ______________
(a) arrays
(b) variables
(c) functions
(d) data types

Neither of these answers are correct, though you state that (c) is the
answer. A C program is more than a collection of functions. What
about object declarations? Type declarations? The correct answer
should be "declarations".

Question 3 states: Its given that variable x has been assigned a value
of 5, which of the following statement will output the message "I am
quite right"

(a) if (x!=5) printf("I am quite right");
(b) if (x=5) printf("I am quite right");
(c) both statements will display the message
(d) none of the above

You give answer (d) as the correct answer, when in fact the correct
answer is (b). Remember, assignment expressions have a value too...

Question 6: I don't like the wording of this question. The term
"assignment" here I think is not really correct

---------------
Dataset 2
---------------

Question 1: This may just be a language barrier issue, but
"alphabets" should be "letters"

Question 5: I'm not sure that you should be so dogmatic about the use
of infinite loops. They should not be used if you can avoid them, but
I know Linux uses them a lot. Perhaps there are cases where you need
to use them...

Question 8: This may be bit-picking, but my interpretation of the
Standard is that void actually *is* a value, but it is an empty value
that cannot be used. I would be interested to know why this
description was used. Why not just say void means "returning no value"

Question 9: Sorry, your answer is wrong. You declare an array of 10
characters. You can fit 10 characters in it. The answer is not 9.
There is no rule that the last element of an array of char must be a
null character. And even if there was, the null character is *still*
a character!

--------------
Dataset 3
--------------

Question 2: Replace the word "commands" with "directives"

Question 3: Where is the condition contained in round brackets?

Question 6: Answer (d) is correct, not answer (c)

Question 7: Answer (c) is given as correct, but goto is not a loop
statement

Question 8: A function *always* returns one value. Just because it
is a pointer does not mean that it returns *many* values

Question 9: All arguments are pass by value

Question 10: 12 bytes is incorrect. The value is implementation
defined, because a structure may have any amount of padding between
its members or following the last member.
Regards,
B.

Oct 6 '07 #3
bo*******@gmail.com wrote:
Question 8: This may be bit-picking, but my interpretation of the
Standard is that void actually *is* a value, but it is an empty value
that cannot be used.
An expression of type void has a nonexistent value,
which to my way of thinking,
means that expressions of type void don't have values.

N869
6.3.2.2 void
[#1] The (nonexistent) value of a void expression (an
expression that has type void) shall not be used in any way,
and implicit or explicit conversions (except to void) shall
not be applied to such an expression.

--
pete
Oct 6 '07 #4
bo*******@gmail.com wrote:
>
On Oct 6, 5:22 pm, Dexter <yousaf.a...@gmail.comwrote:
Visithttp://www.thinkanddone.com/exams/main.aspx
Some of the questions could be better worded, and some of the
questions are just plain wrong.

--------------
Dataset 1
--------------

Question 1 states: A C program is a collection of ______________
(a) arrays
(b) variables
(c) functions
(d) data types

Neither of these answers are correct, though you state that (c) is the
answer. A C program is more than a collection of functions. What
about object declarations? Type declarations? The correct answer
should be "declarations".
External declarations.

A C program consists of:
1 preprocessor directives
2 comments
3 external declarations
4 extra white space

--
pete
Oct 6 '07 #5
On Oct 6, 6:43 pm, pete <pfil...@mindspring.comwrote:
boroph...@gmail.com wrote:
Question 8: This may be bit-picking, but my interpretation of the
Standard is that void actually *is* a value, but it is an empty value
that cannot be used.

An expression of type void has a nonexistent value,
which to my way of thinking,
means that expressions of type void don't have values.

N869
6.3.2.2 void
[#1] The (nonexistent) value of a void expression (an
expression that has type void) shall not be used in any way,
and implicit or explicit conversions (except to void) shall
not be applied to such an expression.

--
pete
Agreed, I was too lazy to look it up properly

Oct 6 '07 #6
pete wrote, On 06/10/07 09:47:
bo*******@gmail.com wrote:
>On Oct 6, 5:22 pm, Dexter <yousaf.a...@gmail.comwrote:
>>Visithttp://www.thinkanddone.com/exams/main.aspx
>Some of the questions could be better worded, and some of the
questions are just plain wrong.

--------------
Dataset 1
--------------

Question 1 states: A C program is a collection of ______________
(a) arrays
(b) variables
(c) functions
(d) data types

Neither of these answers are correct, though you state that (c) is the
answer. A C program is more than a collection of functions. What
about object declarations? Type declarations? The correct answer
should be "declarations".

External declarations.

A C program consists of:
1 preprocessor directives
2 comments
3 external declarations
4 extra white space
To get a C program you need at least one definition (although a
definition is of course also a declaration). If your are including
comments in your list, then why not statements?
--
Flash Gordon
Oct 6 '07 #7
Flash Gordon wrote:
>
pete wrote, On 06/10/07 09:47:
bo*******@gmail.com wrote:
On Oct 6, 5:22 pm, Dexter <yousaf.a...@gmail.comwrote:
>Visithttp://www.thinkanddone.com/exams/main.aspx
Some of the questions could be better worded, and some of the
questions are just plain wrong.

--------------
Dataset 1
--------------

Question 1 states: A C program is a collection of ______________
(a) arrays
(b) variables
(c) functions
(d) data types

Neither of these answers are correct, though you state that (c) is the
answer. A C program is more than a collection of functions. What
about object declarations? Type declarations? The correct answer
should be "declarations".
External declarations.

A C program consists of:
1 preprocessor directives
2 comments
3 external declarations
4 extra white space

To get a C program you need at least one definition (although a
definition is of course also a declaration). If your are including
comments in your list, then why not statements?
Because statments are part of function definitions
and function definitions are external declarations.

--
pete
Oct 6 '07 #8
pete wrote:
>
Flash Gordon wrote:

pete wrote, On 06/10/07 09:47:
bo*******@gmail.com wrote:
>On Oct 6, 5:22 pm, Dexter <yousaf.a...@gmail.comwrote:
>
>>Visithttp://www.thinkanddone.com/exams/main.aspx
>
>Some of the questions could be better worded, and some of the
>questions are just plain wrong.
>>
>--------------
>Dataset 1
>--------------
>>
>Question 1 states: A C program is a collection of ______________
>(a) arrays
>(b) variables
>(c) functions
>(d) data types
>>
>Neither of these answers are correct,
>though you state that (c) is the
>answer. A C program is more than
>a collection of functions. What
>about object declarations? Type declarations?
>The correct answer should be "declarations".
>
External declarations.
>
A C program consists of:
1 preprocessor directives
2 comments
3 external declarations
4 extra white space
To get a C program you need at least one definition (although a
definition is of course also a declaration). If your are including
comments in your list, then why not statements?

Because statments are part of function definitions
and function definitions are external declarations.
N869

6.9 External definitions

[#4] As discussed in 5.1.1.1, the unit of program text after
preprocessing is a translation unit, which consists of a
sequence of external declarations.

--
pete
Oct 6 '07 #9
On Oct 6, 8:27 pm, pete <pfil...@mindspring.comwrote:
pete wrote:
Flash Gordon wrote:
pete wrote, On 06/10/07 09:47:
boroph...@gmail.com wrote:
On Oct 6, 5:22 pm, Dexter <yousaf.a...@gmail.comwrote:
>Visithttp://www.thinkanddone.com/exams/main.aspx
Some of the questions could be better worded, and some of the
questions are just plain wrong.
--------------
Dataset 1
--------------
Question 1 states: A C program is a collection of ______________
(a) arrays
(b) variables
(c) functions
(d) data types
Neither of these answers are correct,
though you state that (c) is the
answer. A C program is more than
a collection of functions. What
about object declarations? Type declarations?
The correct answer should be "declarations".
External declarations.
A C program consists of:
1 preprocessor directives
2 comments
3 external declarations
4 extra white space
To get a C program you need at least one definition (although a
definition is of course also a declaration). If your are including
comments in your list, then why not statements?
Because statments are part of function definitions
and function definitions are external declarations.

N869

6.9 External definitions

[#4] As discussed in 5.1.1.1, the unit of program text after
preprocessing is a translation unit, which consists of a
sequence of external declarations.

--
pete
The question would need to be qualified as "preprocessed C program"
for it to be precise

Regards,
B.

Oct 6 '07 #10
On Oct 6, 1:10 pm, Army1987 <army1...@NOSPAM.itwrote:
On Sat, 06 Oct 2007 00:22:53 -0700, Dexter wrote:
My site is home to series of quizzes ranging from Accounting,
Business, Math to programming languages. These are multiple choice
type questions and you get a score card at end.
For C language, I have 3 set of quizzes that anyone is welcome to try
online for free.
Questions on C quizzes are rather easy to solve for Professional C
programmers yet for those who are taking C as a first programming
course will find these useful in assesment their C
knowledge
Visithttp://www.thinkanddone.com/exams/main.aspx

I found something wrong already at the first level.
Question 3 is:
3 . Its given that variable x has been assigned a value of 5, which of the following statement will output the message "I am quite right"
if (x!=5) printf("I am quite right");
if (x=5) printf("I am quite right");
both statements will display the message
none of the above
The second statement will assign 5 to x (which happens to already
have that value, but that's irrelevant) and, since the result of
that assignment can never be zero, it will execute the expression
statement consisting of the printf call. So I checked the second
answer, but the test believes the correct answer to be "none of
the above".

--
Army1987 (Replace "NOSPAM" with "email")
A hamburger is better than nothing.
Nothing is better than eternal happiness.
Therefore, a hamburger is better than eternal happiness.
I made errors when compiling the examset. Many thanks for your insight
into C topics

I have reloaded DataSet1 with error proned question replaced with new
ones.

DataSet2 and Dataset3 have been unloaded and will be corrected and
reloaded later this afternoon

Oct 6 '07 #11
On Sat, 06 Oct 2007 05:44:06 -0700, Dexter wrote:
On Oct 6, 1:10 pm, Army1987 <army1...@NOSPAM.itwrote:
>On Sat, 06 Oct 2007 00:22:53 -0700, Dexter wrote:
My site is home to series of quizzes ranging from Accounting,
Business, Math to programming languages. These are multiple choice
type questions and you get a score card at end.
For C language, I have 3 set of quizzes that anyone is welcome to try
online for free.
Questions on C quizzes are rather easy to solve for Professional C
programmers yet for those who are taking C as a first programming
course will find these useful in assesment their C
knowledge
Visithttp://www.thinkanddone.com/exams/main.aspx

I found something wrong already at the first level.
Question 3 is:
3 . Its given that variable x has been assigned a value of 5, which of the following statement will output the message "I am quite right"
if (x!=5) printf("I am quite right");
if (x=5) printf("I am quite right");
both statements will display the message
none of the above
The second statement will assign 5 to x (which happens to already
have that value, but that's irrelevant) and, since the result of
that assignment can never be zero, it will execute the expression
statement consisting of the printf call. So I checked the second
answer, but the test believes the correct answer to be "none of
the above".
I made errors when compiling the examset. Many thanks for your insight
into C topics

I have reloaded DataSet1 with error proned question replaced with new
ones.
I think that the point you were trying to verify with that
question, namely the difference between comparison and assignment,
is important, but using zeroes instead of fives you could verify
it without the test expecting a factually incorrect answer.
--
Army1987 (Replace "NOSPAM" with "email")
A hamburger is better than nothing.
Nothing is better than eternal happiness.
Therefore, a hamburger is better than eternal happiness.

Oct 6 '07 #12
On Sat, 06 Oct 2007 04:47:25 -0400, pete wrote:
bo*******@gmail.com wrote:
>>
On Oct 6, 5:22 pm, Dexter <yousaf.a...@gmail.comwrote:
Visithttp://www.thinkanddone.com/exams/main.aspx
>Some of the questions could be better worded, and some of the
questions are just plain wrong.

--------------
Dataset 1
--------------

Question 1 states: A C program is a collection of ______________
(a) arrays
(b) variables
(c) functions
(d) data types

Neither of these answers are correct, though you state that (c) is the
answer. A C program is more than a collection of functions. What
about object declarations? Type declarations? The correct answer
should be "declarations".

External declarations.

A C program consists of:
1 preprocessor directives
2 comments
3 external declarations
4 extra white space
You should make up your mind. Is the program the set of
preprocessing-files or of (preprocessed) translation units? In the
former case, they are made by groups of lines, and each line is
either a directive or it isn't. At this level, doing that
distinction is not very useful, as external declarations could be
built with macros and/or other IOCCC preprocessing trickery.
In the latter case, after preprocessing (translation phases 1-4)
there are no more comments, and translation units are made of
external declarations. See A.2.4 and A.3.

--
Army1987 (Replace "NOSPAM" with "email")
A hamburger is better than nothing.
Nothing is better than eternal happiness.
Therefore, a hamburger is better than eternal happiness.

Oct 6 '07 #13
On Sat, 06 Oct 2007 08:18:57 +0000, borophyll wrote:
On Oct 6, 5:22 pm, Dexter <yousaf.a...@gmail.comwrote:
>For C language, I have 3 set of quizzes that anyone is welcome to try
online for free.
Questions on C quizzes are rather easy to solve for Professional C
programmers yet for those who are taking C as a first programming
course will find these useful in assesment their C
knowledge

Visithttp://www.thinkanddone.com/exams/main.aspx
Some of the questions could be better worded, and some of the
questions are just plain wrong.

--------------
Dataset 1
--------------
Question 6: I don't like the wording of this question. The term
"assignment" here I think is not really correct
Well, ++E is defined in terms of (E+=1), so the distinction is
really immaterial.
---------------
Dataset 2
---------------
Question 9: Sorry, your answer is wrong. You declare an array of 10
characters. You can fit 10 characters in it. The answer is not 9.
There is no rule that the last element of an array of char must be a
null character. And even if there was, the null character is *still*
a character!
IIRC it talks about strings. Anyway, since the null is part of the
string, but the length of a string is defined as the number of
characters excluding the null, the wording shoul be "of length 9"
not "of 9 characters".
--
Army1987 (Replace "NOSPAM" with "email")
A hamburger is better than nothing.
Nothing is better than eternal happiness.
Therefore, a hamburger is better than eternal happiness.

Oct 6 '07 #14
Army1987 wrote:
>
On Sat, 06 Oct 2007 04:47:25 -0400, pete wrote:
bo*******@gmail.com wrote:
>
On Oct 6, 5:22 pm, Dexter <yousaf.a...@gmail.comwrote:
Visithttp://www.thinkanddone.com/exams/main.aspx
Some of the questions could be better worded, and some of the
questions are just plain wrong.

--------------
Dataset 1
--------------

Question 1 states: A C program is a collection of ______________
(a) arrays
(b) variables
(c) functions
(d) data types

Neither of these answers are correct,
though you state that (c) is the
answer. A C program is more than a collection of functions. What
about object declarations? Type declarations? The correct answer
should be "declarations".
External declarations.

A C program consists of:
1 preprocessor directives
2 comments
3 external declarations
4 extra white space
You should make up your mind. Is the program the set of
preprocessing-files or of (preprocessed) translation units?
No.
A program is the source files.
Have you ever written a C program?

N869
5.1.1.1 Program structure
[#1] A C program need not all be translated at the same
time. The text of the program is kept in units called
source files, (or preprocessing files) in this International
Standard.

--
pete
Oct 6 '07 #15
On Sat, 06 Oct 2007 13:09:38 -0400, pete wrote:
Army1987 wrote:
>On Sat, 06 Oct 2007 04:47:25 -0400, pete wrote:
bo*******@gmail.com wrote:
Neither of these answers are correct, though you state that (c) is
the
answer. A C program is more than a collection of functions. What
about object declarations? Type declarations? The correct answer
should be "declarations".

External declarations.

A C program consists of:
1 preprocessor directives
2 comments
3 external declarations
4 extra white space
You should make up your mind. Is the program the set of
preprocessing-files or of (preprocessed) translation units?

No.
A program is the source files.
In other words, the preprocessing files (from the text you quoted).
Preprocessing files consist of lines, not external declarations. The
preprocessed translation unit will consist of external declarations, but
the preprocessed translation unit is not a source file.
Have you ever written a C program?
Was that necessary?
Oct 6 '07 #16
=?iso-2022-kr?q?=1B=24=29CHarald_van_D=0E=29=26=0Fk?= wrote:
>
On Sat, 06 Oct 2007 13:09:38 -0400, pete wrote:
Army1987 wrote:
On Sat, 06 Oct 2007 04:47:25 -0400, pete wrote:
bo*******@gmail.com wrote:
Neither of these answers are correct, though you state that (c) is
the
answer. A C program is more than a collection of functions. What
about object declarations? Type declarations? The correct answer
should be "declarations".

External declarations.

A C program consists of:
1 preprocessor directives
2 comments
3 external declarations
4 extra white space
You should make up your mind. Is the program the set of
preprocessing-files or of (preprocessed) translation units?
No.
A program is the source files.

In other words, the preprocessing files (from the text you quoted).
Yes. I said the wrong thing.
Preprocessing files consist of lines, not external declarations. The
preprocessed translation unit will
consist of external declarations, but
the preprocessed translation unit is not a source file.
Have you ever written a C program?

Was that necessary?
Thinking about what writing a C program involves,
should give you some idea of what a C program is.

--
pete
Oct 6 '07 #17
In data Sat, 06 Oct 2007 13:56:48 -0400, pete scrisse:
>=?iso-2022-kr?q?=1B=24=29CHarald_van_D=0E=29=26=0Fk?= wrote:
>>
On Sat, 06 Oct 2007 13:09:38 -0400, pete wrote:
Army1987 wrote:
On Sat, 06 Oct 2007 04:47:25 -0400, pete wrote:
bo*******@gmail.com wrote:
Neither of these answers are correct, though you state that (c) is
the
answer. A C program is more than a collection of functions. What
about object declarations? Type declarations? The correct answer
should be "declarations".

External declarations.

A C program consists of:
1 preprocessor directives
2 comments
3 external declarations
4 extra white space
You should make up your mind. Is the program the set of
preprocessing-files or of (preprocessed) translation units?

No.
A program is the source files.

In other words, the preprocessing files (from the text you quoted).

Yes. I said the wrong thing.
>Preprocessing files consist of lines, not external declarations. The
preprocessed translation unit will
consist of external declarations, but
the preprocessed translation unit is not a source file.
Have you ever written a C program?

Was that necessary?

Thinking about what writing a C program involves,
should give you some idea of what a C program is.
A C program is a written text that follow the definitions of the C
language text definitions
Oct 6 '07 #18
¬a\/b wrote:
In data Sat, 06 Oct 2007 13:56:48 -0400, pete scrisse:
>>=?iso-2022-kr?q?=1B=24=29CHarald_van_D=0E=29=26=0Fk?= wrote:
>>>
On Sat, 06 Oct 2007 13:09:38 -0400, pete wrote:
Army1987 wrote:
On Sat, 06 Oct 2007 04:47:25 -0400, pete wrote:
bo*******@gmail.com wrote:
Neither of these answers are correct, though you state that
(c) is the
answer. A C program is more than a collection of functions.
What
about object declarations? Type declarations? The correct
answer should be "declarations".

External declarations.

A C program consists of:
1 preprocessor directives
2 comments
3 external declarations
4 extra white space
You should make up your mind. Is the program the set of
preprocessing-files or of (preprocessed) translation units?

No.
A program is the source files.

In other words, the preprocessing files (from the text you quoted).

Yes. I said the wrong thing.
>>Preprocessing files consist of lines, not external declarations. The
preprocessed translation unit will
consist of external declarations, but
the preprocessed translation unit is not a source file.

Have you ever written a C program?

Was that necessary?

Thinking about what writing a C program involves,
should give you some idea of what a C program is.

A C program is a written text that follow the definitions of the C
language text definitions
A C source file is written text. A C program is an executable which was
compiled from a C source file.

Oct 6 '07 #19
On Sat, 06 Oct 2007 00:22:53 -0700, Dexter <yo*********@gmail.com>
wrote:
>
Visit http://www.thinkanddone.com/exams/main.aspx
There's an error here:

3 . Its given that variable x has been assigned a value of 5, which of
the following statement will output the message "I am quite right"

o if (x!=5) printf("I am quite right");
o if (x=5) printf("I am quite right");
o both statements will display the message
o none of the above

You say "none of the above" is the correct answer; but actually "if
(x=5) printf("I am quite right");" is the correct answer.
K. H.

--

E-mail: info<at>simple-line<Punkt>de
Oct 6 '07 #20
Karl Heinze wrote:
On Sat, 06 Oct 2007 00:22:53 -0700, Dexter <yo*********@gmail.com>
wrote:
>>
Visit http://www.thinkanddone.com/exams/main.aspx

There's an error here:

3 . Its given that variable x has been assigned a value of 5, which
of the following statement will output the message "I am quite right"

o if (x!=5) printf("I am quite right");
o if (x=5) printf("I am quite right");
o both statements will display the message
o none of the above

You say "none of the above" is the correct answer; but actually "if
(x=5) printf("I am quite right");" is the correct answer.
Yes, but I suspect the question itself is misleading. I think the OP
meant to write an equality comparison in the second if, not an
assignment.

Or it may be that he, (the OP), _did_ mean an assignment to illustrate
that in C an assignment expression evaluates to the value of the LHS
after the assignment.

Oct 6 '07 #21
On Oct 7, 12:41 am, Army1987 <army1...@NOSPAM.itwrote:
On Sat, 06 Oct 2007 08:18:57 +0000, borophyll wrote:
On Oct 6, 5:22 pm, Dexter <yousaf.a...@gmail.comwrote:
For C language, I have 3 set of quizzes that anyone is welcome to try
online for free.
Questions on C quizzes are rather easy to solve for Professional C
programmers yet for those who are taking C as a first programming
course will find these useful in assesment their C
knowledge
Visithttp://www.thinkanddone.com/exams/main.aspx
Some of the questions could be better worded, and some of the
questions are just plain wrong.
--------------
Dataset 1
--------------
Question 6: I don't like the wording of this question. The term
"assignment" here I think is not really correct

Well, ++E is defined in terms of (E+=1), so the distinction is
really immaterial.---------------
Dataset 2
---------------
Question 9: Sorry, your answer is wrong. You declare an array of 10
characters. You can fit 10 characters in it. The answer is not 9.
There is no rule that the last element of an array of char must be a
null character. And even if there was, the null character is *still*
a character!

IIRC it talks about strings. Anyway, since the null is part of the
string, but the length of a string is defined as the number of
characters excluding the null, the wording shoul be "of length 9"
not "of 9 characters".
--
Army1987 (Replace "NOSPAM" with "email")
A hamburger is better than nothing.
Nothing is better than eternal happiness.
Therefore, a hamburger is better than eternal happiness.
We can't be sure, since it appears our friend has removed datasets 2
and 3
Oct 7 '07 #22
On Oct 7, 8:40 am, santosh <santosh....@gmail.comwrote:
Karl Heinze wrote:
On Sat, 06 Oct 2007 00:22:53 -0700, Dexter <yousaf.a...@gmail.com>
wrote:
Visithttp://www.thinkanddone.com/exams/main.aspx
There's an error here:
3 . Its given that variable x has been assigned a value of 5, which
of the following statement will output the message "I am quite right"
o if (x!=5) printf("I am quite right");
o if (x=5) printf("I am quite right");
o both statements will display the message
o none of the above
You say "none of the above" is the correct answer; but actually "if
(x=5) printf("I am quite right");" is the correct answer.

Yes, but I suspect the question itself is misleading. I think the OP
meant to write an equality comparison in the second if, not an
assignment.

Or it may be that he, (the OP), _did_ mean an assignment to illustrate
that in C an assignment expression evaluates to the value of the LHS
after the assignment.
We cannot know what the OP meant, but either way (b) is still the
correct answer

Oct 7 '07 #23

"santosh" <sa*********@gmail.comwrote in message
>
A C source file is written text. A C program is an executable which was
compiled from a C source file.
That's a program written in C.
A C program is a collection of one or more source files including a main()
and all subroutines called from it, excluding those in libraries it is
dependent upon.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Oct 7 '07 #24

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: vpd | last post by:
hi, I want some help in organising an online programming contest. Is there a ready made solution available in PHP or even Perl which I could use? The contest is supposed to be based on C...
13
by: Varun | last post by:
Hi Friends, Department of Information Technology, Madras Institute of Technology, Anna University, India is conducting a technical symposium, Samhita. As a part of samhita, an Online Programming...
0
by: Sridhar | last post by:
Hi, We, the students of CEG, Anna University are organizing an online programming contest as part of aBaCus 2005. The contest itself will start on 6th March 2005 at 1:00 pm IST and will end...
0
by: Sridhar | last post by:
Hi, We, the students of CEG, Anna University are organizing an online programming contest as part of aBaCus 2005. The contest itself will start on 6th March 2005 at 1:00 pm IST and will end...
1
by: Doron | last post by:
Hi, anybody familiar with any online PL/SQL programming courses I can look up on the web?
14
by: pravink | last post by:
Hi all, I am interested in knowing any periodic (montly/weekly) programming challeages held on internet...Does anybody know about such sites? Focus should be on algorithm development and...
0
by: ravehanker | last post by:
Hello There! College of Engineering, Guindy announces the Kurukshetra Online Programming Contest as a part of it's Inter-departmental Tech. Fest, Kurukshetra. The event is your opportunity to...
0
by: Romram | last post by:
BITWISE is an annual online programming contest. The contest is organized by the Computer Science and Engineering Department Society of IIT Kharagpur, on the second Sunday of February every year....
0
by: Turbo | last post by:
Please ignore if you are not interested in programming contests. IIIT Hyderabad invites you to our annual Online Programming Contest CodeCraft 2007. This is the 5th year of Codecraft. It has...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.