Prepare
Practice
Interview
Aptitude
Reasoning
English
GD
Placement papers
HR
Current affairs
Engineering
MCA
MBA
Online test
Login
Online Practice Test
>
c
« Previous
Next »
main()
{
struct
{
int i;
}abc;
(*abc)->i=10;
printf("%d",abc.i);
}
What is the output of this program?
Options
- address of i
- 10
- program will not compile
- None of the above
CORRECT ANSWER : program will not compile
Discussion Board
Answer & corerct code
-The answer is, program will not compile. It means error is occurred during compilation.
Following is the correct code:
main()
{
struct s
{
int i;
}abc;
struct s *pt=&abc;
pt->i=10;
printf("%d",abc.i);
}
After writing this correct code output will be 10.
Sapna 02-16-2017 05:18 AM
C
also syntax error,it is not correct syntax for struct
Aisha Syed 11-26-2014 11:05 AM
description
This is not the correct way to assign value to a pointer.We cannot directly assign value to a pointer.
Ritika Manchanda 09-24-2014 01:26 PM
c
very good probnlem\s
rajesh yadav 10-30-2013 11:48 PM
c
ever ans have description. why become this ans..because this is a programming language.
Awanish kumar 09-15-2013 03:03 PM
« Previous
Next »
Write your comments
*
*
Email must be in the form someone@domain.com
*
*
Enter the code shown above:
Please enter the code shown above
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)
Related Content
C test (42)
C (12)
C++ for beginners (10)
C++ (20)
C++ (24)
C++ (18)
C++ (14)
C++ (12)
C++ (15)
C++ (15)
Data structure (20)
Data structure (10)
Data structure (10)
Data structure (10)
PERL (25)
VC++ (11)
Oops (30)
Mainframe (41)
Mainframe (15)
Embedded systems (15)
OOAD (49)
Advertisement
▲