CC++
BAN USER
Questions (5)
Comments (1)
Reputation 0
- 0of 0 votes
AnswersWhat would be the output for the following code fragment?
- CC++ in United States
main()
{
int i=300;
char *ptr = &i;
*++ptr=2;
printf("%d",i);
}| Report Duplicate | Flag | PURGE
C - 0of 0 votes
AnswersWhat would be the output for the following code fragment?
- CC++ in United States
void foo(int b[][3] );
main()
{
int a [3][3]= { { 1,2,3} , { 4,5,6},{7,8,9}};
foo(a);
printf("%d" , a[2][1]);
}
void foo( int b[][3])
{
++ b;
b[1][1] =9;
}
(a) 8
(b) 9
(c) 7
(d) None of the above| Report Duplicate | Flag | PURGE
C - 0of 0 votes
AnswersWhat does the following represent?
- CC++ in United States
void (*abc(int, void (*def)()))();| Report Duplicate | Flag | PURGE
C
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
void main()
- CC++ June 06, 2012{
char str[25];
int i,j,k;
gets(str);
for (i=0;str[i]!='\0';i++)
{
if(str[i]==' '&&str[i+1]==' ')
{
j=i+2;
while(str[j]==' ')
j++;
for(k=i;str[j]!='\0';k++,j++)
{
str[k]=str[j];
}
str[k]='\0';
i--;
}
}
puts(str);
}