Point out the error in the program?
#include<stdio.h>
int main()
{
struct emp
{
char name[20];
float sal;
};
struct emp e[10];
int i;
for(i=i<=i++)
scanf("%s %f", e[i].name, &e[i].sal);
return}
How will you free the allocated memory ?
Point out the error in the program?
#include<stdio.h>
int main()
{
struct emp
{
char name[25];
int age;
float bs;
};
struct emp e;
e.name = "Suresh";
e.age = printf("%s %d\n", e.name, e.age);
return}
What will be the output of the program in Turbo C (under DOS)?
#include<stdio.h>
int main()
{
struct emp
{
char *n;
int age;
};
struct emp e1 = {"Dravid", 23};
struct emp e2 = e strupr(e2.n);
printf("%s\n", e1.n);
return}
Point out the error in the program?
#include<stdio.h>
int main()
{
struct emp
{
char n[20];
int age;
};
struct emp e1 = {"Dravid", 23};
struct emp e2 = e if(e1 == e printf("The structure are equal");
return}
The '->' operator can be used to access structures elements using a pointer to a structure variable only
What is the similarity between a structure, union and enumeration?
What will be the output of the program in 16-bit platform (under DOS)?
#include<stdio.h>
int main()
{
struct node
{
int data;
struct node *link;
};
struct node *p, *q;
p = (struct node *) malloc(sizeof(struct node));
q = (struct node *) malloc(sizeof(struct node));
printf("%d, %d\n", sizeof(p), sizeof(q));
return}
Point out the error in the program?
#include<stdio.h>
int main()
{
struct bits
{
float f: }bit;
printf("%d\n", sizeof(bit));
return}
It is not possible to create an array of pointer to structures.
A union cannot be nested in a structure
Can a structure can point to itself?
Is there easy way to print enumeration values symbolically?
If the following structure is written to a file using fwrite(), can fread() read it back successfully?
struct emp
{
char *n;
int age;
};
struct emp e={"IndiaBIX", 15};
FILE *fp;
fwrite(&e, sizeof(e),fp);
What will be the output of the program ?
#include<stdio.h>
int main()
{
union var
{
int a, b;
};
union var v;
v.a= v.b= printf("%d\n", v.a);
return}
What will be the output of the program ?
#include<stdio.h>
int main()
{
struct byte
{
int one: };
struct byte var = {1};
printf("%d\n", var.one);
return}
What will be the output of the program ?
#include<stdio.h>
int main()
{
union var
{
int a, b;
};
union var v;
v.a= v.b= printf("%d\n", v.a);
return}
Nested unions are allowed
If a char is 1 byte wide, an integer is 2 bytes wide and a long integer is 4 bytes wide then will the following structure always occupy 7 bytes?
struct ex
{
char ch;
int i;
long int a;
};
By default structure variable will be of auto storage class