Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/articles/c-tutorials/)
-   -   100 Multiple choice questions in C (http://www.go4expert.com/articles/100-multiple-choice-questions-c-t1373/)

MultipleChoiceInC 22May2008 03:18

Re: 100 Multiple choice questions in C(New Question?)
 
Which one of the following Standard C functions can be used to sort a string array?
Choice 1

qsort (Ans)
Choice 2

sort
Choice 3

quicksort
Choice 4

asort
Choice 5

There is no Standard C function for such a sort.

MultipleChoiceInC 22May2008 03:20

Re: 100 Multiple choice questions in C
 
int a[100];
int *p=a;

for(;a<p+100; a++)
*a=0;

a=p;

Which one of the following describes the error in the sample code above?
Choice 1

The initialization of p from a is not allowed since the compiler believes that they have differing types. There should be whitespace between the star and p to achieve the desired effect.
Choice 2

It is not permissible to omit the initializer of a for loop.
Choice 3

The address of the first element not in the array a is p + 100 * sizeof(int), not p + 100.
Choice 4

It is not permissible to alter the value of a. (Ans)
Choice 5

The iterator of the for loop should be a += sizeof(int) instead of a++.

MultipleChoiceInC 22May2008 05:20

Re: 100 Multiple choice questions in C(New Q?)
 
#include <stdlib.h>

int main()
{
struct x {double d; int i; char c;};

struct x *xp=(struct x*)calloc(1, sizeof(struct x));

}

Referring to the above sample code, what are the values of the structure members pointed to by "xp" after the "calloc"?
Choice 1

undefined,undefined,undefined
Choice 2

1.0,1,'\01'
Choice 3

undefined,0,'\0' (Ans)
Choice 4

0.0,0,'\0'
Choice 5

0e0,0,'\0'

madlex 7Jun2008 06:52

Re: 100 Multiple choice questions in C
 
Quote:

Originally Posted by shabbir
By definition, an lvalue is the storage space indirectly referenced by a pointer.

I am not that sure that is the answer.
By definition an lvalue is a "value" that can take part in an assigment on the left side. More particular, the lvalue is a "writable" value, and an rvalue is a "readable" value. Nothing to do with pointers.
for example:
(1+2) its a rvalue -> we could never write (1+2) = 4 :P
but this is a lvalue but also a rvalue
int & something()
{
static int something = 0;
return something;
}
something() = 3; // something() as lvalue
int some_thing = something(); // something() as rvalue

shabbir 7Jun2008 10:18

Re: 100 Multiple choice questions in C
 
So it means indirectly referenced by pointer. Your example of something also does the same.

madlex 7Jun2008 19:45

Re: 100 Multiple choice questions in C
 
Code:

//  Oki, but what pointer reference do we have here?
const int anything = 12;
int some_thing = anything;
some_thing = 0; // lvalue = rvalue
// Consider that we can use a pointer to point to an rvalue also
const char * pszSomething = "Hello";
// Considering the statement above, what would be the difference between rvalue and lvalue
// if this is the definition of an lvalue?!

That's why I think the choice "All lvalues can be used on the right side of an assignment statement. (Ans--?)" was marked as the answer, because is the most plausible of all. This means that If a value is a lvalue it can also be used as an rvalue.

And about the function int & something(); I used in the previous example,I should say that not all the references are "translated" by the compiler into pointers.In this case, it should not. But that's debatable depending on what do you mean by "pointer".

If I am wrong correct me please.
Cheers

Samdani 23Jun2008 20:28

Re: 100 Multiple choice questions in C
 
pls can anyone send me the answers at samdanikalpesh@gmail.com

XXxxImmortalxxXX 7Jul2008 13:24

Re: 100 Multiple choice questions in C
 
mate your not allowed to advertise on this forum like that

amit8_j 8Dec2008 12:05

Re: 100 Multiple choice questions in C
 
Please send me the answers to these questions at my ID amit8.j@tcs.com
Thanks
Amit

guneet 17Mar2009 13:04

Re: 100 Multiple choice questions in C !!i need answers!!
 
wud u plz send me answers for these 100 mcqs at the undersigned-as soon as possible!!
guneet2027@gmail.com

mishra.vaibhav00 24Mar2009 18:39

Re: 100 Multiple choice questions in C
 
can anyone please provide me the ans of the above question from 1 to 100 on mishra.vaibhav00@gmail.com or vaibhavmishra9235@gmail.com or vaibhavmishra0@gmail.com it's urgent

vartika 3Apr2009 20:03

Re: 100 Multiple choice questions in C
 
hello
plz mail me answers at vartika.mishra27@gmail.com
im making a website on online examination as my project so i need ans of the question...
is the option mark as [ans] is the right answer plz tel me so that i can complete my website...

shabbir 3Apr2009 21:38

Re: 100 Multiple choice questions in C
 
yes ans marked are answers but I am not sure we have them for all

archag 10Apr2009 11:36

Re: 100 Multiple choice questions in C
 
Can you please send me the answers at abg_manit@yahoo.com. I need them urgently

JamC 6Jun2009 18:22

Re: 100 Multiple choice questions in C
 
Quote:

Not all the answers are correct. Perhaps you should expend some additional effort before publishing misleading or inaccurate information.
Best post of the entire thread...

elkovou 11Jun2009 16:41

Re: 100 Multiple choice questions in C
 
can some1 pl mail the answers to me at elkovou@hotmail.com

elkovou 11Jun2009 16:49

Re: 100 Multiple choice questions in C
 
can some1 pl mail the answers to me at
elkovou@hotmail.com

elkovou 12Jun2009 13:39

Re: 100 Multiple choice questions in C
 
Quote:

Originally Posted by uma (Post 8454)
how to send the answers?

maybe by email
elkovou@hotmail.com

muthu4love 25Aug2009 23:17

Re: 100 Multiple choice questions in C
 
friends,can you sent the answers to rmuthu18@yahoo.com

monicka 14Jan2010 17:27

Re: 100 Multiple choice questions in C
 
plz mail me the answers by today at monica_adarsh@yahoo.com. thanx in advance

monicka 14Jan2010 17:28

Re: 100 Multiple choice questions in C
 
monica_adarsh@yahoo.com

abhishekmadaan 14Jan2010 23:19

Re: 100 Multiple choice questions in C
 
can someone can send the solutions to abmadaan@yahoo.com

jeklin 12Feb2010 12:16

Re: 100 Multiple choice questions in C
 
Hello,
I am newbie in this forum site.
Thanks.

darshit 21Feb2010 14:19

Re: 100 Multiple choice questions in C
 
plz mail me the answers as soon as possible @ darshlakhani@gmail.com

Janani175 27Feb2010 12:38

Re: 100 Multiple choice questions in C
 
can i get these answers mailed to me at jrjpink@gmail.com.PL pl i badly need them

krazytechno 8Mar2010 14:31

Re: 100 Multiple choice questions in C
 
This sorts of things must be organised here.There should be a question here for all members
and to those who gives the right answer must be guven credit.It will increase the poularity
of the website.

shamilahamed 9Mar2010 19:02

Re: 100 Multiple choice questions in C
 
its very nice & useful too..
pls attach the answers..

rpbhatia 13Mar2010 13:29

Re: 100 Multiple choice questions in C
 
hey pls mail me the answers at rpbhatia6@hotmail.com
pls its urgent need it by sunday

sheva249 6May2010 12:51

Re: 100 Multiple choice questions in C
 
Plz mail the answers for me too on playboy2409@gmail.com

Lohit 10May2010 08:59

Re: 100 Multiple choice questions in C
 
can some one plzz mail me the answers on my mail id: lohitts1@yahoo.com
its urgent!!!!!!

seangtz 11May2010 10:08

Re: 100 Multiple choice questions in C
 
It would be very helpful if you share the answers...

ishit 18May2010 07:19

Re: 100 Multiple choice questions in C
 
plz attach the answer
i need them

asishbabu 20Aug2010 15:15

Re: 100 Multiple choice questions in C
 
hi viewer's this is Asish and I wanna proggram in 'C'and the question will be like this actually I don't have much time to get program by my self
so please help me.........
Here is the question:need 25 questions ( technical ) with 4 options and and each question must carry 4 marks(if the answer is right) and cut off marks will be 3(when the answer is wrong ). So, Please help me. and here is my email id asishbabu@ymail.com
thank you
with regards
ASISH.

matuatua 1Sep2010 17:10

Re: 100 Multiple choice questions in C
 
thanks alot for the questions as it will help me prepare for my c final exams in my college
but please attach the answers to them,i will also post some questions to these existing ones for others to also benefit

matuatua 2Sep2010 03:29

Re: 100 Multiple choice questions in C
 
consider the following two output statements:
printf(s);
printf("%s" , s);
If the character string s contains the string "mary received 98% for her C test" the first statement
will fail ,whereas the second will work correctly produce the expected output.Can you explain why?

Write a program to determine if the statement
printf("%20.2f", num);
produces 97.77 or 97.78 when num is given the value of 97.7779.What can you conclude about the rounding or truncating features of the printf function?
Please email it to my facebook inbox by please searching for tetteh mark spears on facebook

rajith12345 22Oct2010 11:21

Re: 100 Multiple choice questions in C
 
i need the answers for all the questions above... can anyone mail me the answers to rajith_039@yahoo.co.in or rajith.039@gmail.in...........
or suggest me where to find it....????

bemette 22Nov2010 01:28

Re: 100 Multiple choice questions in C
 
i need answers as soon as possible, plzz help :worried:
my email address is;
narcissusnarcosiss@hotmail.com

khush1978 26Dec2010 11:05

Re: please tell answers 100 Multiple choice questions in C
 
please tell me the answers 100 Multiple choice questions in C

at khush1978@yahoo.com

rameshb 27Dec2010 17:00

Re: 100 Multiple choice questions in C
 
Some questions asked are irrelevent .

sahar_2010 30Dec2010 13:16

Re: 100 Multiple choice questions in C
 
i have a big problem .plz can anybody here write me the program for this question??
here is my question:
a program that can do this:
gcd(a,b)+lcm(a,b)=a+b
condition: 1<=a,b<=100

plz if u do so i will be so happy thanks,i think its so easy but because im new in writing program in c,i cant write this program.plz help me plz.


All times are GMT +5.5. The time now is 05:30.