If int is 2 bytes wide.What will be the output of the program?
#

Home | Discussion Forum

If int is 2 bytes wide.What will be the output of the program?

#include <stdio.h>
void fun(char**);
int main()
{
char *argv[] = {"ab", "cd", "ef", "gh"};
fun(argv);
return 0;
}
void fun(char **p)
{
char *t;
t = (p+= sizeof(int))[-1];
printf("%s\n", t);
}

View More Related Question

1) What will be the output of the program?

#include<stdio.h>
#include<stdlib.h>
int main()
{
int i=0;
i++;
if(i<=5)
{
printf("Study2Online");
exit(1);
main();
}
return 0;
}

2) What will be the output of the program?

#include<stdio.h>
int main()
{
int fun(int);
int i = fun(10);
printf("%d\n", --i);
return 0;
}
int fun(int i)
{
return (i++);
}

3) How many times the program will print "Study 2 Online" ?

  #include<stdio.h>
int main()
{
printf("Study 2 Online");
main();
return 0;
}

4) What will be the output of the program?

#include<stdio.h>
int fun(int);
int main()
{
float k=3;
fun(k=fun(fun(k)));
printf("%f\n", k);
return 0;
}
int fun(int i)
{
i++;
return i;
}

5) Which of the following statements are correct about the program?

#include<stdio.h>
int main()
{
printf("%p\n", main());
return 0;
}

UP Gk Online Test

taiyari24hour.com