GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Placement Papers  >  TCS  >  C
Go To First  |  Previous Question  |  Next Question 
 C  |  Question 53 of 87    Print  
Consider the following structure:
struct num nam
{
int no;
char name[25];
}
struct num nam n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}};
.....
.....
printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1);

What does the above statement print?

A. 8,9
B. 9,9
C. 8,8
D. 8,unpredictable value


  
Total Answers and Comments: 2 Last Update: December 29, 2006   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
August 18, 2006 01:49:19   #1  
nagesh k        

RE: Consider the following structure:struct num n...
n1[2].no in the above quetion is 8. (*(n1+2).no) is also same as n1[2].no hence result is 8 8+1 i.e 8 9
 
Is this answer useful? Yes | No
December 28, 2006 20:40:18   #2  
lava        

RE: Consider the following structure:struct num n...
A. 8 9But the printf needs to be this way...printf( d d n1[2].no (*(n1 + 2)).no + 1);
 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : semicolon ...

What is false about the following A compound statement is a.A set of simple statmentsb.Demarcated on either side by curly bracketsc.Can be used in place of simple statementd.A C function is not a compound statement.

Write one statement equivalent to the following two statementsx=sqr(a);return(x);Choose from one of the alternativesa.return(sqr(a));b.printf("sqr(a)");c.return(a*a*a);d.printf("%d",sqr(a));

Which of the following represents true statementeither x is inthe range of 10 and 50 or y is zeroa.x>=10 && x<=50 || y==0;b.c.d.

What does the following function print?func(int i){if(i%2)return 0;eale return 1;}main(){int =3;i=func(i);i=func(i);printf("%d",i);}a.3b.1c.0d.2

A memory of 20 bytes is allocated to a string declared as char *sthen the following two statements are executed:s="Etrance"l=strlen(s);what is the value of l ?a.20b.8c.9d.21

Consider the following structure:struct num nam{int no;char name[25];};struct num nam n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}};..........printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1);What does the above statement print?a.8,9b.9,9c.8,8d.8,unpredictable value

Regarding the scope of the varibles;identify the incorrect statement:a.automatic variables are automatically initialised to 0b.static variables are are automatically initialised to 0c.the address of a register variable is not accessiabled.static variables cannot be initialised with any expression

Latest Answer : answer is 5 times ...

# define prod(a,b)=a*bmain(){int x=2;int y=3;printf("%d",prod(x+2,y-10)); }the output of the program is a.8b.6c.7d.none


 Sponsored Links

 
Related Articles

Print Servers

Print Servers Print server is a server or advice that is used to connect many printers of a network to it Using the print server any computer on the network can give a print command to the server and the print server will get the job done accordingly Usually a print server is configured on a compute
 

C++ Structure Part II

C Structure Part II In this C tutorial Structures Part II you will learn how to use structure in an efficient way and features of structures explained with examples mosgoogle center Structure Members Initialization As with arrays and variables structure members can also be initialized This is perfor
 

C++ Structure

C Structure In this C tutorial you will learn about Structure declaring a Structure how to declare Structure Variable and how to access the structure members in C mosgoogle What is a Structure Structure is a collection of variables under a single name Variables can be of any type int float char et
 

What is Common Data Structure

In big data warehouses such as those used by business organizations which may have many branches around the world and which may have diversified products and services, different kinds of data flood the warehouse every single day. These data may come from other warehouse data sources, or simply fresh
 

printf() Function Return Value

What is the return value from printf() function? printf function always returns the number of characters printed. Let us understand this with an example: main() { int a=10; printf(&quot;%d&quot;,printf(&quot;%d %d %d&quot;, a,a,a)); } In this above program the inner printf i
 

What are the Format Specifiers used with printf?

There are several format specifiers available in printf. The format specifier used varies depending on the data type used for printing. The given below are some of the format specifiers used with printf in C program. For integer data type the format specifier used with printf is %d or %i For float
 

What are the limitations with switch statement?

Switch statement is a powerful statement used to handle many alternatives and provides good presentation for C program. But there are some limitations with switch statement which are given below: Logical operators cannot be used with switch statement. For instance case k&gt;=20: is not allowe
 

printf and sprintf

What is the difference between printf and sprintf? sprintf: Writes formatted data to a character string in memory instead of stdout Syntax of sprintf is: #include &lt;stdio.h&gt; int sprintf (char *string, const char *format [,item [,item]...]); Here, String refers to the pointer to a
 

goto Statement

Why to avoid goto in C C has goto statement but one must ensure not to use too much of goto statement in their program because its functionality is limited and it is only recommended as a last resort if structured solutions are much more complicated. First let us understand the goto statement, its
 

ITIL Structure

In this article, let us go through some of the aspects involved in the ITIL Structure. Business Perspective The business perspective is meant to familiarize the Business Management with the supporting components and the architectural design of the Information and Technology (ICT), the infrastructure
 

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