C Language - Functions

You Are Here :: Home > C Language > Functions - General Questions

 
43.

What is the output of this program?

#include
using namespace std;
void mani()
void mani()
{
cout<<"hai";
}
int main()
{
mani();
return 0;
}
A. hai B. haihai
C. compile time error D. none of the mentioned




44.

What is the output of this program?

#include
using namespace std;
void fun(int x, int y)
{
x = 20;
y = 10;
}
int main()
{
int x = 10;
fun(x, x);
cout << x;
return 0;
}

A. 10 B. 20
C. compile time error D. none of the mentioned




45.

#include

/* program section begins here */
int main() {
// opening brace - program execution starts here
printf("Welcome to the C");
return 0;
}
// closing brace - program terminates here

A. Welcome to B. the C
C. Welcome to the C D. compiletime error




46.

#include

int main(int argc, char *argv[]) {
int n;
printf("Following are the arguments entered in the command line");
for (n = 0; n < argc; n++) {
printf("\n %s", argv[n]);
}
printf("\n Number of arguments entered are\n %d\n", argc);
return 0;
}

A. apple
mango
Number of arguments entered are
2
B. apple
mango
Number of arguments entered are
0
C. apple
mango
Number of arguments entered are
3
D. error




47.

void *memcpy(void *destination,void *source,size_t count);

#include
#include
main()
{
char str1[100] = "This is string";
char str2[100];
memcpy(str2,str1,14);
printf("str2 = %s\n",str2);
}

A. str2 = This B. str2 = This is str
C. str2 = This is string D. str2 = error




48.

#include

#include
void main( )
{
double ans ;
double n = 4 ;
ans = ldexp ( n, 2 ) ;
printf ( "\nThe ldexp value is : %lf\n", ans ) ;
}

A. ldexp value is : 2.000000 B. ldexp value is : 4.000000
C. ldexp value is : 16.000000 D. ldexp value is : 64.000000




« previous

1

2

3

4

5

6

7

8

9

...

next »

 
 
 



© 2013 freshersindia.in ® | Copyrights | Terms & Conditions
   Designed by Freshers India
Catch Us on