Programming Hub C,C++,C#,Asp.Net,Ado.Net,Java,  HTML,SQL.

This Blog Post Only Education Purpose For All Education Related Blogs and Articles Post Here.Download Free Software and Study Materials Mores..

Friday, 6 January 2017

Data and File Structure Using C Multiple Choice Questions

Thank you Visiting In Advance BY IT PROGRAMMING WORLD
Data and File Structure Using C
Multiple Choice Questions
Note: - All Answers in Red Color

1.       What is the output of this C Code?
#include<stdio.h>
main()
{
                int a[2][3]={1,2,3,4,5};
                int i=0,j=0;
                for(i=0;i<2;i++)
                for(j=0;j<3;j++)
                printf("%d",a[i][j]);
                }
a)      1 2 3 4 5 0
b)      1 2 3 4 5 junk
c)       1 2 3 4 5 5
d)      Run time error


2.        What is the output of this C Code?
#include<stdio.h>
main()
{
                int a[2][3]={1,2,3,,4,5};
                int i=0,j=0;
                for(i=0;i<2;i++)
                for(j=0;j<3;j++)
                printf("%d",a[i][j]);
                }
a)      1 2 3 junk 4 5
b)      Compile time error
c)        1 2 3 0 4 5
d)      1 2 3 3 4 5


3.       What is the output of this C Code?
#include<stdio.h>
void f(int a[][3])
 {
                a[0][1]=3;
                int i=0,j=0;
                for(i=0;i<2;i++)
                for(j=0;j<3;j++)
                printf("%d",a[i][j]);
                }
                main()
                {
                                int a[2][3]={0};
                                f(a);
                             
                }
a)      0 3 0 0 0 0
b)       Junk 3  Junk Junk Junk Junk
c)       Compile time error
d)      All junk values


4.       What is the output of the C code?
       #include<stdio.h>
void f(int a[][])
 {
                a[0][1]=3;
                int i=0,j=0;
                for(i=0;i<2;i++)
                for(j=0;j<3;j++)
                printf("%d",a[i][j]);
                }
                main()
                {
                                int a[2][3]={0};
                                f(a);
                             
                }
a)      0 3 0 0 0 0
b)      Junk 3  Junk Junk Junk Junk
c)       Compile time error
d)      All junk values


5.       What is the Output of this C code?
#include<stdio.h>
void f(int a[2][])
 {
                a[0][1]=3;
                int i=0,j=0;
                for(i=0;i<2;i++)
                for(j=0;j<3;j++)
                printf("%d",a[i][j]);
                }
                main()
                {
                                int a[2][3]={0};
                                f(a);
                             
                }
a)      0 3 0 0 0 0
b)      Junk 3  Junk Junk Junk Junk
c)       Compile time error
d)      All junk values


6.       What is the output of this C Code?
#include<stdio.h>
void foo(int *)
main()
{
                int i=10;
                foo((&i)++);
}
void foo(int *p)
                printf("%d",*p);
                }
a)      10
b)      Some garbage value
c)       Compile time errord)      Segmentation fault/code crash


7.       What is the output of this C code?
#include<stdio.h>
void foo(int *);
int  main()
{
                int i=10, *p=&i;
                foo(p++);
             
}
void foo(int *p)
{
                printf("%d\n",*p);
                }
a)      10
b)      Some garbage value
c)       Compile time error
d)      Segmentation fault


8.       What is the output of this C code?
#include<stdio.h>
void foo(float *);
 main()
{
                int i=10, *p=&i;
                foo(&i);
             
}
void foo(float *p)
{
                printf("%f\n",*p);
                }
a)      10
b)      0.0000
c)       Compile time error
d)      Segmentation fault


9.       What is output of this C Code?
#include<stdio.h>
void foo(int *);
 main()
{
                int i=97, *p=&i;
                foo(&i);
                printf("%d\n",*p);
             
}
void foo(int *p)
{
                int j=2;
                p=&j;
                printf("%d\n",*p);
                }
             
a)      2 97
b)      2 2
c)       Compile time error
d)      Code crush


10.   What is the output of this C code?
#include<stdio.h>
void foo(int **);
 main()
{
                int i=97, *p=&i;
                foo(&p);
                printf("%d\n",*p);
                return 0;
             
             
}
void foo(int **p)
{
                int j=2;
                *p=&j;
                printf("%d\n",**p);
                }
             
a)      2 97
b)      2 2
c)       Compile time error
a)      Code crush


No comments:

Post a Comment

Please Comment Your Valuable Feedback....

You Might Also Like

Developing Data-Centric Windows Applications using Java

Developing Data-Centric Windows Applications using Java Introduction The Core Java Programming and JDBC course provides an introd...

Unlimited Reseller Hosting