ENiAC
Would you like to react to this message? Create an account in a few clicks or log in to continue.

ENiAC

Pioneer college of Arts and Science | BSc & BCA Student forum
 
HomeSearchLatest imagesRegisterGalleryLog in
Congratulations to University Rank Holders: B.C.A: K.Sathyavaishnavi-I RANK, S.Maheswari-V RANK | M.Sc: S.Samanthadevi-III RANK, T.Ambika-IV RANK, S.Sharmila-VI RANK | M.Com: K.Malathi- V RANK, F.Aseena-VIII RANK, R.Saravanakumar-X RANK.
Latest topics
» NANO TECHNOLOGY
C,C++ Questions3 I_icon_minitimeWed Dec 08, 2010 8:26 pm by ARUNTHATHIMOHAN

» Kaspersky 35 years validity key... amazing hack..
C,C++ Questions3 I_icon_minitimeSun Dec 05, 2010 9:06 am by sarathbabu

» Mobile telephony standards[0G,1G,2G,3G,4G,5G technology]
C,C++ Questions3 I_icon_minitimeSun Dec 05, 2010 4:14 am by sarathbabu

» 3G Technology
C,C++ Questions3 I_icon_minitimeSun Dec 05, 2010 4:09 am by sarathbabu

» Detail about IMEI number
C,C++ Questions3 I_icon_minitimeSun Dec 05, 2010 4:03 am by sarathbabu

» SIM CARD[meaning]
C,C++ Questions3 I_icon_minitimeSun Dec 05, 2010 3:59 am by sarathbabu

» smartphone
C,C++ Questions3 I_icon_minitimeSun Dec 05, 2010 3:55 am by sarathbabu

» Blender [animation] must see.....
C,C++ Questions3 I_icon_minitimeSun Dec 05, 2010 3:49 am by sarathbabu

» Blender [animation]
C,C++ Questions3 I_icon_minitimeSun Dec 05, 2010 3:49 am by sarathbabu

» GPS System Technology
C,C++ Questions3 I_icon_minitimeSat Nov 20, 2010 6:36 pm by venkatesh

» கண்களை நம்பாதீர்கள்
C,C++ Questions3 I_icon_minitimeWed Nov 17, 2010 11:06 pm by Admin

» CSS – ஆரம்ப வழிகாட்டி தமிழில்.
C,C++ Questions3 I_icon_minitimeWed Nov 17, 2010 10:52 pm by Admin

» Top 10 Latest Inventions
C,C++ Questions3 I_icon_minitimeSat Nov 13, 2010 10:24 pm by venkatesh

» கணினியை பராமரிக்க எழிய வழிமுறைகள்
C,C++ Questions3 I_icon_minitimeSat Nov 13, 2010 10:18 pm by venkatesh

» Easy To Pick The Wndows Xp Key
C,C++ Questions3 I_icon_minitimeSat Nov 13, 2010 10:12 pm by venkatesh

Top posters
Admin
C,C++ Questions3 I_vote_lcapC,C++ Questions3 I_voting_barC,C++ Questions3 I_vote_rcap 
sarathbabu
C,C++ Questions3 I_vote_lcapC,C++ Questions3 I_voting_barC,C++ Questions3 I_vote_rcap 
Divya
C,C++ Questions3 I_vote_lcapC,C++ Questions3 I_voting_barC,C++ Questions3 I_vote_rcap 
kanimozhi
C,C++ Questions3 I_vote_lcapC,C++ Questions3 I_voting_barC,C++ Questions3 I_vote_rcap 
SUBASRI
C,C++ Questions3 I_vote_lcapC,C++ Questions3 I_voting_barC,C++ Questions3 I_vote_rcap 
venkatesh
C,C++ Questions3 I_vote_lcapC,C++ Questions3 I_voting_barC,C++ Questions3 I_vote_rcap 
samson
C,C++ Questions3 I_vote_lcapC,C++ Questions3 I_voting_barC,C++ Questions3 I_vote_rcap 
manickaraaj
C,C++ Questions3 I_vote_lcapC,C++ Questions3 I_voting_barC,C++ Questions3 I_vote_rcap 
Mathivanan
C,C++ Questions3 I_vote_lcapC,C++ Questions3 I_voting_barC,C++ Questions3 I_vote_rcap 
ARUNTHATHIMOHAN
C,C++ Questions3 I_vote_lcapC,C++ Questions3 I_voting_barC,C++ Questions3 I_vote_rcap 
Gallery
C,C++ Questions3 Empty
Poll
Which Internet Browser do you prefer?
Internet Explorer(IE)
C,C++ Questions3 I_vote_lcap8%C,C++ Questions3 I_vote_rcap
 8% [ 1 ]
Netscape
C,C++ Questions3 I_vote_lcap0%C,C++ Questions3 I_vote_rcap
 0% [ 0 ]
Opera
C,C++ Questions3 I_vote_lcap8%C,C++ Questions3 I_vote_rcap
 8% [ 1 ]
mozilla firefox
C,C++ Questions3 I_vote_lcap33%C,C++ Questions3 I_vote_rcap
 33% [ 4 ]
google chrome
C,C++ Questions3 I_vote_lcap17%C,C++ Questions3 I_vote_rcap
 17% [ 2 ]
Epic Browser
C,C++ Questions3 I_vote_lcap25%C,C++ Questions3 I_vote_rcap
 25% [ 3 ]
Other
C,C++ Questions3 I_vote_lcap8%C,C++ Questions3 I_vote_rcap
 8% [ 1 ]
Total Votes : 12
Social bookmarking
Social bookmarking reddit      

Bookmark and share the address of ENiAC on your social bookmarking website

Bookmark and share the address of ENiAC on your social bookmarking website
Search
 
 

Display results as :
 
Rechercher Advanced Search

 

 C,C++ Questions3

Go down 
AuthorMessage
sarathbabu




Posts : 57
Reputation/vote (வாக்கு) : 0
Join date : 2010-08-23
Age : 33
Location : COIMBATORE

C,C++ Questions3 Empty
PostSubject: C,C++ Questions3   C,C++ Questions3 I_icon_minitimeMon Aug 23, 2010 3:34 am

26. Find the output for the following C program
main()
{
int x=20,y=35;
x = y++ + x++;
y = ++y + ++x;
printf("%d %d\n",x,y);
}
Ans. 57 94
27. Find the output for the following C program
main()
{
int x=5;
printf("%d %d %d\n",x,x<<2,x>>2);
}
Ans. 5 20 1
28 Find the output for the following C program
#define swap1(a,b) a=a+b;b=a-b;a=a-b;
main()
{
int x=5,y=10;
swap1(x,y);
printf("%d %d\n",x,y);
swap2(x,y);
printf("%d %d\n",x,y);
}
int swap2(int a,int b)
{
int temp;
temp=a;
b=a;
a=temp;
return;
}
Ans. 10 5

29 Find the output for the following C program
main()
{
char *ptr = "Ramco Systems";
(*ptr)++;
printf("%s\n",ptr);
ptr++;
printf("%s\n",ptr);
}
Ans. Samco Systems

30 Find the output for the following C program
#include
main()
{
char s1[]="Ramco";
char s2[]="Systems";
s1=s2;
printf("%s",s1);
}
Ans. Compilation error giving it cannot be an modifiable 'lvalue'

31 Find the output for the following C program
#include
main()
{
char *p1;
char *p2;
p1=(char *) malloc(25);
p2=(char *) malloc(25);
strcpy(p1,"Ramco");
strcpy(p2,"Systems");
strcat(p1,p2);
printf("%s",p1);
}
 Ans. RamcoSystems

32. Find the output for the following C program given that
[1]. The following variable is available in file1.c
static int average_float;
Ans. All the functions in the file1.c can access the variable

33. Find the output for the following C program
# define TRUE 0
some code
while(TRUE)
{
some code
}
Ans. This won't go into the loop as TRUE is defined as 0
34. struct list{
       int x;
      struct list *next;
      }*head;

        the struct head.x =100

       Is the above assignment to pointer is correct or wrong ?
Ans. Wrong
35.What is the output of the following ?

      int i;
      i=1;
      i=i+2*i++;
      printf(%d,i);
Ans. 4
36. FILE *fp1,*fp2;
     
      fp1=fopen("one","w")
      fp2=fopen("one","w")
      fputc('A',fp1)
      fputc('B',fp2)
      fclose(fp1)
      fclose(fp2)
     }

     Find the Error, If Any?
Ans. no error. But It will over writes on same file.
37. What are the output(s) for the following ?
38. #include
      char *f()
      {char *s=malloc(Cool;
        strcpy(s,"goodbye");
     }

      main()
      {
      char *f();
      printf("%c",*f()='A');     }


39. #define MAN(x,y) (x)>(y)?(x):(y)
      {int i=10;
      j=5;
      k=0;
      k=MAX(i++,++j);
      printf(%d %d %d %d,i,j,k);
      }
Ans. 10 5 0
40.
void main()
{
int i=7;
printf("%d",i++*i++);
}

Ans: 56
Embarassed
Back to top Go down
 
C,C++ Questions3
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
ENiAC :: Interview preperation and Placement Papers-
Jump to: