how to return a multiple value from a function?
Answers were Sorted based on User's Feedback
Answer / krishna
You will have to use a structure or an array and then return
a pointer to the structure/array.
Is This Answer Correct ? | 3 Yes | 3 No |
What is the problem with the following code segment? while ((fgets(receiving array,50,file_ptr)) != EOF) ;
Write a program to model an exploding firecracker in the xy plane using a particle system
main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }
9 Answers CSC, GoDB Tech, IBM,
main() { char *cptr,c; void *vptr,v; c=10; v=0; cptr=&c; vptr=&v; printf("%c%v",c,v); }
Print an integer using only putchar. Try doing it without using extra storage.
Question: We would like to design and implement a programming solution to the reader-writer problem using semaphores in C language under UNIX. We assume that we have three readers and two writers processes that would run concurrently. A writer is to update (write) into one memory location (let’s say a variable of type integer named temp initialized to 0). In the other hand, a reader is to read the content of temp and display its content on the screen in a formatted output. One writer can access the shared data exclusively without the presence of other writer or any reader, whereas, a reader may access the shared memory for reading with the presence of other readers (but not writers).
Is the following statement a declaration/definition. Find what does it mean? int (*x)[10];
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; }
#include<stdio.h> main() { register i=5; char j[]= "hello"; printf("%s %d",j,i); }
How we print the table of 3 using for loop in c programing?
#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d----%d",*p,*q); }
writte a c-programm to display smill paces