dovetail-reg

22 views
Skip to first unread message

Nithya selvan R

unread,
Aug 1, 2011, 2:35:30 AM8/1/11
to unix...@googlegroups.com
For this question no . 10

10. Code:

FILE *f = fopen( fileName, "r" );

readData( f );

if( ???? )

{

 puts( "End of file was reached" );

}

Which one of the following can replace the ???? in the code above to determine if the end of a file has been reached?

the answer is
 
Choice 1
f == EOF
Choice 2
feof( f )



--
Warm regards
Nithyaselvan R

lakshmi sivasubramanian

unread,
Aug 1, 2011, 4:51:16 AM8/1/11
to unix...@googlegroups.com
i got this ques n my dovetail ...in tat link d ans will be f == EOF
but i answered feof( f )
--
Thanks & Regards
Lakshmi
Program Analyst Trainee
Cognizant Technology Solution

Nithya selvan R

unread,
Aug 1, 2011, 7:43:18 AM8/1/11
to unix...@googlegroups.com
Another one guys....
35.  All of the following choices represent syntactically correct function definitions.

        Which one of the following represents a semantically legal function definition in Standard C?

(a)

 int count_digits (const char * buf)

{

 assert(buf != NULL);

  int cnt = 0, i;

  for (i = 0; buf[i] != '\0'; i++)

    if (isdigit(buf[i]))

      cnt++;

 return cnt;

}
 
This should be the answer

lakshmi sivasubramanian

unread,
Aug 1, 2011, 10:42:39 PM8/1/11
to unix...@googlegroups.com

(b)

 int count_digits (const char * buf) {

 int cnt = 0;

 assert(buf != NULL);

  for (int i = 0; buf[i] != '\0'; i++)

    if (isdigit(buf[i]))

      cnt++;

  return cnt;

}

 
--
Thanks & Regards

jeeva

unread,
Aug 1, 2011, 10:53:24 PM8/1/11
to unix...@googlegroups.com

Check Answer for question 81 .

divya krishnan

unread,
Aug 2, 2011, 12:13:51 AM8/2/11
to unix...@googlegroups.com
Answer for 81 is choice 4.
ques 176 will show compilation error.
92.compilation error(need constant value in array subscript).
even quest 30 is showing compilatio error only.


On Tue, Aug 2, 2011 at 8:23 AM, jeeva <jeeva...@gmail.com> wrote:

Check Answer for question 81 .




--



Regards,
Divya...

Nithya selvan R

unread,
Aug 2, 2011, 12:53:26 AM8/2/11
to unix...@googlegroups.com
Laxmi...are u sure of that answer for that is
 
(b)
 int count_digits (const char * buf) {
 int cnt = 0;
 assert(buf != NULL);
  for (int i = 0; buf[i] != '\0'; i++)
    if (isdigit(buf[i]))
      cnt++;
  return cnt;
}

Did u get this question and did u answer this correctly ????

Navaneeth Boopathi

unread,
Aug 2, 2011, 1:13:06 AM8/2/11
to unix...@googlegroups.com
guys....is question no :103 correct.

Navaneeth Boopathi

unread,
Aug 2, 2011, 1:13:55 AM8/2/11
to unix...@googlegroups.com
Quest. 103
 
103. Statements
A) A definition allocates storage for the variable.
B) A declaration allocates storage for the variable.
C) A definition can occur multiple times
D) A declaration can occur multiple times
regarding the difference between a declaration and a definition of a variable, which of the above statements are true?
Choice 1          A and C only
Choice 2          A and D only
Choice 3          B and C only
Choice 4          B and D only
Choice 5          none of the above


jeeva

unread,
Aug 2, 2011, 1:17:41 AM8/2/11
to unix...@googlegroups.com
check this i got it frm link send by lux
*question number 8*/
What is a difference between a declaration and a definition of a variable?
Choice 1
Both can occur multiple times, but a declaration must occur first.
Choice 2
There is no difference between them.
Choice 3
A definition occurs once, but a declaration may occur many times.
Choice 4
A declaration occurs once, but a definition may occur many times. [Ans]
Choice 5
Both can occur multiple times, but a definition must occur first.

Jeeva@dreams


jeeva

unread,
Aug 2, 2011, 1:28:38 AM8/2/11
to unix...@googlegroups.com
got  a answer declaration can occur multiple times.....for 103 choice 2 is correct

Jeeva@dreams

Nithya selvan R

unread,
Aug 2, 2011, 3:19:20 AM8/2/11
to unix...@googlegroups.com
No divya we checked it for question 92. Answer is

Choice 5
The array will be initialized with the numbers 0 through 4.(correct)


On Tue, Aug 2, 2011 at 9:43 AM, divya krishnan <divya...@gmail.com> wrote:

divya krishnan

unread,
Aug 2, 2011, 4:15:28 AM8/2/11
to unix...@googlegroups.com
executed uh????or checked in any link?
--



Regards,
Divya...

divya krishnan

unread,
Aug 2, 2011, 4:19:12 AM8/2/11
to unix...@googlegroups.com
Actually when i executed i got that error.If u hav chkd then ok.

On Tue, Aug 2, 2011 at 12:49 PM, Nithya selvan R <nits...@gmail.com> wrote:



--



Regards,
Divya...

Nithya selvan R

unread,
Aug 2, 2011, 4:55:03 AM8/2/11
to unix...@googlegroups.com
ya executed it....

divya krishnan

unread,
Aug 2, 2011, 5:53:29 AM8/2/11
to unix...@googlegroups.com
oka..oka...
--



Regards,
Divya...

Navaneeth Boopathi

unread,
Aug 2, 2011, 12:34:30 PM8/2/11
to unix...@googlegroups.com

Hi guys...Verify the following questions. These options seems to be correct.

 

10.  a & b

14.  a & c

62.  b

98.  a & b

156.  c

160.   e

168.  d

Reply all
Reply to author
Forward
0 new messages