GeekInterview.com
  I am new, Sign me up!
 

Sonata C


Sonata C

Questions: 31
Comments: 53
 Sonata C Tags
 Showing Questions 21-30 of 31 Questions
<< Previous 1 2 [3] 4 Next >>
 Sponsored Links

 
 Sonata C
Sorting Options :  

If the following program (myprog) is run from the command line as myprog friday tuesday sunday, What would be the output? main(int argc, char *argv[]) { while(sizeofargv) printf("%s",argv[--sizeofargv]); } a) myprog friday tuesday sunday b) myprog friday tuesday c) sunday tuesday friday myprog d) sunday tuesday friday

Point out the error in the following program main() { int a=10; void f(); a=f(); printf("n%d",a); } void f() { printf("nHi"); }
The program is trying to collect the value of a "void" function into an integer variable.  

In the following program how would you print 50 using p? main() { int a[]={10, 20, 30, 40, 50}; char *p; p= (char*) a; }
printf("n%d",*((int*)p+4));  

Would the following program compile? main() { int a=10,*j; void *k;< BR> j=k=&a; j++; k++; printf("n%u%u",j,k); } a) Yes b) No, the format is incorrect c) No, the arithmetic operation is not permitted on void pointers d) No, the arithmetic operation is not permitted on pointers

According to ANSI specifications which is the correct way of declaring main() when it receives command line arguments? a) main(int argc, char *argv[]) b) main(argc,argv) int argc; char *argv[]; c) main() {int argc; char *argv[]; } d) None of the above 26. What error would the following function give on compilation? f(int a, int b) { int a; a=20; return a; } a) missing parenthesis in the return statement b) The function should be declared as int f(int a, int b) c) redeclaration of a d) None of the

Point out the error in the following program main() { const char *fun(); *fun()='A'; } const char *fun() { return "Hello"; }
fun() returns to a "const char" pointer which cannot be modified  

What would be the output of the following program? main() { const int x=5; int *ptrx; ptrx=&x; *ptrx=10; printf("%d",x); } a) 5 b) 10 c) Error d) Garbage value

A switch statement cannot include a) constants as arguments b) constant expression as arguments c) string as an argument d) None of the above

How long the following program will run? main() { printf("nSonata Software"); main(); } a) infinite loop b) until the stack overflows c) All of the above d) None of the above

On combining the following statements, you will get char*p; p=malloc(100); a) char *p= malloc(100) b) p= (char*)malloc(100) c) All of the above d) None of the above

View page << Previous 1 2 [3] 4 Next >>

Ask A Question
Go Top
 Sponsored Links

 
Sponsored Links

 
Ask Question
You must login to Ask Question or Register your free account

Category:

 
Question Title:


Question in Detail:

Add this to my Subscribed Questions (?)
Send me email when new answer is posted (?)

 
Expert Members
# User Name Count
1shrutimitra 12
2nirupa 1
3raghumanohar16 1
4sonnathivinil 1
5Rage 1
Subscribe
Get Latest Updates Via RSS Reader or by Email
 Forum Discussion Subscribe to Forum Discussions Via E-Mail Latest Forum Discussions Subscribers
 Knowledge Base Subscribe to Knowledge Base Series Via E-Mail Knowledge Base Subscribers
 Learning Series Subscribe to GeekInterview Learning Series Via EMail Learning Series Subscribers
 Freelance Jobs Subscribe to GeekInterview Freelance Jobs Via EMail Latest Freelance Jobs Subscribers
 GeekInterview Blog Subscribe to GeekInterview Blog Via EMail GeekInterview Blog Subscribers
 Testing Interview Questions Subscribe to Testing Interview Questions Via EMail Testing Interview Questions Subscribers
 Oracle Interview Questions Subscribe to Oracle Interview Questions Via EMail Oracle Interview Questions Subscribers
 Java Interview Questions Subscribe to Java Interview Questions Via EMail Java Interview Questions Subscribers
 Latest Placement Papers Subscribe to Latest Placement Papers Placement Papers Subscribers
 Free Training Subscribe to Free Training Via EMail Free Training Subscribers
 Learn AJAX Subscribe to AJAXwith.com Via EMail AJAXwith Subscribers
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape