C Language Aptitude Test Paper
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
project report helper
Active In SP
**

Posts: 2,270
Joined: Sep 2010
#1
12-10-2010, 10:12 AM



.pdf   C-Language-Aptitude-Test-Paper-By-Placementpapers.net_.pdf (Size: 286.7 KB / Downloads: 212)
‘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
project report helper
Active In SP
**

Posts: 2,270
Joined: Sep 2010
#2
12-10-2010, 10:31 AM


.docx   cpp prog.docx (Size: 13.34 KB / Downloads: 60)
C++ Programs

#include <iostream.h>
#include <conio.h>

void main()
{
clrscr();
int x = 10;
int y = 2;
int sum, difference, product, quotient;
sum = x + y;
difference = x - y;
product = x * y;
quotient = x / y;
cout << "The sum of " << x << " & " << y << " is " << sum << "." << endl;
cout << "The difference of " << x << " & " << "y << is " << difference << "." << endl;
cout << "The product of " << x << " & " << y << " is " << product << "." << endl;
cout << "The quotient of " << x << " & " << y << " is " << quotient << "." << endl;
getch();
}
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

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)

Possibly Related Threads...
Thread Author Replies Views Last Post
  Full Aptitude Questions & Answers study tips 0 1,579 07-06-2013, 12:24 PM
Last Post: study tips
  Electronics & Communication Model Question paper study tips 0 1,142 15-05-2013, 12:25 PM
Last Post: study tips
  Free Situational Judgement Test Questions study tips 0 731 28-02-2013, 12:03 PM
Last Post: study tips
  Knowledge Question Paper 2012 study tips 0 721 18-02-2013, 09:12 AM
Last Post: study tips
  Solved Paper General Knowledge (RRB) Set - 1 project girl 0 594 02-02-2013, 11:42 AM
Last Post: project girl
  TCS On line Written test questions and answer project girl 0 483 29-01-2013, 11:04 AM
Last Post: project girl
  Technical Aptitude Questions pdf project girl 0 679 28-01-2013, 02:26 PM
Last Post: project girl
  Aptitude Questions and Answers pdf project girl 0 742 24-12-2012, 04:40 PM
Last Post: project girl
  Wipro Aptitude Test Dec 2007 project girl 0 605 10-12-2012, 01:06 PM
Last Post: project girl
  TCS Latest Placement Paper Aug 22nd 2010 at SJB college Of Eng,bangalore project girl 0 715 05-12-2012, 06:19 PM
Last Post: project girl