Question
Asked @
Answers
Views
select
main()
{
struct student
{
char name[30];
struct date dob;
}stud;
struct date
{
int day,month,year;
};
scanf("%s%d%d%d", stud.rollno, &student.dob.day,
&student.dob.month, &student.dob.year);
}
1
23
Declare an array of N pointers to functions returning
pointers to functions returning pointers to characters?
1
16
#include <stdio.h>
main()
{
char * str = "hello";
char * ptr = str;
char least = 127;
while (*ptr++)
least = (*ptr<least ) ?*ptr :least;
printf("%d",least);
}
1
16
main()
{
int i=300;
char *ptr = &i;
*++ptr=2;
printf("%d",i);
}
1
20
main()
{
int i = 258;
int *iPtr = &i;
printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) );
}
1
16
main()
{
int i = 257;
int *iPtr = &i;
printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) );
}
1
18
main()
{
void swap();
int x=10,y=8;
swap(&x,&y);
printf("x=%d y=%d",x,y);
}
void swap(int *a, int *b)
{
*a ^= *b, *b ^= *a, *a ^= *b;
}
1
24
main()
{
static int a[3][3]={1,2,3,4,5,6,7,8,9};
int i,j;
static *p[]={a,a+1,a+2};
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
printf("%d\t%d\t%d\t%d\n",*(*(p+i)+j),
*(*(j+p)+i),*(*(i+p)+j),*(*(p+j)+i));
}
}
1
20
int DIM(int array[])
{
return sizeof(array)/sizeof(int );
}
main()
{
int arr[10];
printf(“The dimension of the array is %d”, DIM(arr));
}
1
21
#define DIM( array, type) sizeof(array)/sizeof(type)
main()
{
int arr[10];
printf(“The dimension of the array is %d”, DIM(arr,
int));
}
1
14
main()
{
char *p="GOOD";
char a[ ]="GOOD";
printf("\n sizeof(p) = %d, sizeof(*p) = %d, strlen(p) = %d",
sizeof(p), sizeof(*p), strlen(p));
printf("\n sizeof(a) = %d, strlen(a) = %d",
sizeof(a), strlen(a));
}
1
16
main()
{
int a=2,*f1,*f2;
f1=f2=&a;
*f2+=*f2+=a+=2.5;
printf("\n%d %d %d",a,*f1,*f2);
}
1
15
main()
{
extern i;
printf("%d\n",i);
{
int i=20;
printf("%d\n",i);
}
}
1
16
main()
{
float i=1.5;
switch(i)
{
case 1: printf("1");
case 2: printf("2");
default : printf("0");
}
}
1
15
main()
{
register int a=2;
printf("Address of a = %d",&a);
printf("Value of a = %d",a);
}
1
22
E-Mail New Answers
Answer Selected Questions
Post New C Code Question
Prev 1 2 [3] 4 ... 5 ... 7 ... 9 ... 11 ... 13 ... 15 ... 17 ... 19 ... 21 Next
Un-Answered Questions
Question
Views
Asked at
Select
write a program for area of circumference of shapes
29
Write a program to model an exploding firecracker in the xy
plane using a particle system
391
HCL
Develop a routine to reflect an object about an arbitrarily
selected plane
301
Implement a t9 mobile dictionary.
(Give code with explanation )
513
Yahoo
Can you send Code for Run Length Encoding Of BMP Image in C
Language in linux(i.e Compression and Decompression) ?
433
Honeywell
find simple interest & compund interest
45
Given a spherical surface, write bump-mapping procedure to
generate the bumpy surface of an orange
338
Set up procedure for generating a wire frame display of a
polyhedron with the hidden edges of the object drawn with
dashed lines
319
IBM
why nlogn is the lower limit of any sort algorithm?
22
Write a routine to implement the polymarker function
406
can u give me the c codings for converting a string into
the hexa decimal form......
201
how many processes will gate created execution of
--------
fork();
fork();
fork();
--------
Please Explain...
Thanks in advance..!
5
GATE entrance
Design an implement of the inputs functions for event mode
300
Write a program to implement the motion of a bouncing ball
using a downward gravitational force and a ground-plane
friction force. Initially the ball is to be projected in to
space with a given velocity vector
508
How to count a sum, when the numbers are read from stdin and
stored into a structure?
27
create a C-code that will display the total fare of a
passenger of a taxi if the driver press enter,the timer will
stop. Every 10 counts is 2 pesos.
Initial value is 25.00
120
Microsoft
main()
{
int (*functable[2])(char *format, ...) ={printf, scanf};
int i = 100;
(*functable[0])("%d", i);
(*functable[1])("%d", i);
(*functable[1])("%d", i);
(*functable[0])("%d", &i);
}
a. 100, Runtime error.
b. 100, Random number, Random number, Random number.
c. Compile error
d. 100, Random number
7
HCL
main()
{
extern int i;
{ int i=20;
{
const volatile unsigned i=30; printf("%d",i);
}
printf("%d",i);
}
printf("%d",i);
}
int i;
50
E-Mail New Answers
Answer Selected Questions