C Language Aptitude Test Paper
#1

[attachment=5628]
‘C’ Language Aptitude Test Paper




Note : All the programs are tested under Turbo C/C++ compilers.
It is assumed that,
 Programs run under DOS environment,
 The underlying machine is an x86 system,
 Program is compiled using Turbo C/C++ compiler.
The program output may depend on the information based on this assumptions (for example
sizeof(int) == 2 may be assumed).
Predict the output or error(s) for the following:
1. void main()
{
int const * p=5;
printf("%d",++(*p));
}
Answer:Compiler error: Cannot modify a constant value.
Explanation:
p is a pointer to a "constant integer". But we tried to change the value of the "constant
integer".
2. main()
{
char s[ ]="man";
int i;
for(i=0;s[ i ];i++)
printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]);
}
Answer:
mmmm
aaaa
nnnn
Explanation:
s[i], *(i+s), *(s+i), i[s] are all different ways of expressing the same idea. Generally array
name is the base address for that array. Here s is the base address. i is the index number/displacement from
the base address. So, indirecting it with * is same as s[i]. i[s] may be surprising. But in the case of C it is
same as s[i].
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: 3d plm aptitude que, mechanical aptitude practice test, schlumberger geoservices mi swaco employment aptitude test, documentation of aptitude test project, aptitude test of c c compiler, aptitude testing, aptitude test papers on c language,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Messages In This Thread
C Language Aptitude Test Paper - by project report helper - 12-10-2010, 10:12 AM

Possibly Related Threads...
Thread Author Replies Views Last Post
  A Paper Presentation on Software Development Automation by Computer Aided Software seminar paper 4 3,155 23-03-2016, 02:05 PM
Last Post: dhanabhagya
  DYNAMIC LANGUAGE seminar addict 2 1,975 03-01-2013, 12:30 PM
Last Post: seminar details
  ELECTRICAL ENGINEERING paper 2 seminar paper 1 1,212 12-10-2012, 12:39 PM
Last Post: seminar details
  An Introduction to the Analytical Writing Section of the GRE® revised General Test computer girl 0 484 11-06-2012, 03:06 PM
Last Post: computer girl
  Paper-Based Augmented Reality seminar details 0 744 09-06-2012, 04:11 PM
Last Post: seminar details
  A New Low Power Test Pattern Generator Using a Variable-Length Ring Counter seminar details 0 1,209 07-06-2012, 04:54 PM
Last Post: seminar details
  Battery Technology Life Verification Test Manual seminar details 0 892 07-06-2012, 12:40 PM
Last Post: seminar details
  C++ Language Tutorial seminar paper 0 2,038 16-03-2012, 12:11 PM
Last Post: seminar paper
  Brief Introduction to the C Programming Language seminar paper 0 990 15-03-2012, 02:14 PM
Last Post: seminar paper
  Solar Cars Hit the Road to Test Route 66 Course seminar paper 0 903 09-03-2012, 02:09 PM
Last Post: seminar paper

Forum Jump: