Signal Number Default Action Remarks SIGWAITING 32 Ignore Cocurrancy signal used by threads library SIGLWP 33 Ignore Inter LWP signal used by thread library Where LWP: light … Continue reading
what is selection and bubble sorting implemented //
what is the difference between compiler and assembler?
#include <stdio.h> int main() { int a[5][5],c[5][5],i,j; int b[2][3]={{1,2,3},{3,4,5}}; for(i=0;i<5;i++) { for(j=0;j<5;j++) { printf(“array B: %d\n”,b[i][j]); printf(“enter array A: “); scanf(“%d”,&a[i][j]); c[i][j]=a[i][j]+b[i][j]; printf(“c[%d}[%d] : %d \n\n “,i,j,c[i][j]); } } return 0; … Continue reading
#include<stdio.h> union logic { int i; char x[2]; //char y; }emb={510,’A’,’B’}; int main() { printf(“%d\n”,emb.i); printf(“%c\n”,emb.x[0]); printf(“%c\n”,emb.x[1]); printf(“%d\n”,emb.i); }
#include<stdio.h> #include<string.h> struct logic { char ch[10]; char x; int y; char z; //int i; }; int main() { struct logic *p; strcpy(p->ch,”hello”); p->x=’b’; p->y=42; p->z=’c’; printf(“%s\n%c\n%d\n%c\n”,p->ch,p->x,p->y,p->z); }
char (* ( *f())[])(); How to evaluate that kind of expression??
#include int insertion_sort(int *a,int elem) { int temp=0,temp2=0,max=0,i=0,j=0; for(i=0;i<elem-1;i++) { temp=*(a+i+1); for(j=i;temp0;j–) *(a+j+1)=*(a+j); *(a+j)=temp; } printf(“sorting done…”); return 0; } int main() { int a[]={10,9,8,7,6,5,4,3,2,1},i=0; insertion_sort(a,10); for(i=0;i<=10;i++) printf("%d\n",*(a+i)); return 0; }
{ int x=1,y=1,z=1; x+=y+=z; printf(“%d\n”,x<y?y:x); printf(“%d\n”,x<y?x++:y++); printf(“%d\n”,x);printf(“%d\n”,y); printf(“%d\n”,z+=x<y?x++:y++); printf(“%d\n”,y);printf(“%d\n”,z); x=3,y=z=4; printf(“%d\n”,z>=y>=x?1:0); printf(“%d\n”,z>=y&&y>=x)
in qo 3 how airthmetic operators are performing
Can any one tell me how printf is executing….
#include<string.h> #include<stdio.h> #include<stdlib.h> int main() { int d; printf(“enter size of the string\n”); scanf(“%d”,&d); char a[100]; char *p; p = malloc(sizeof(char)*d); printf(“enter the string\n”); fflush(stdin); fgets(p,d,stdin); //didn’t worked with gets(p)????????? int i,j,count=0,flag=0; for(i=0;i<=”;i++) { for(j=0;j<i;j++) { if(*(p+i)==a[j]) { flag=-1; } … Continue reading
{ char r[10]=”this is a”; char d[10]={{‘t’},{‘h’},{‘i’},{‘s’},{‘ ‘},{‘i’},{‘s’},{‘ ‘},{‘a’}}; printf(“string r[10] %s size %d\n”,r,sizeof(r)); printf(“single character d[10] %s size %d\n”,d,sizeof(d)); return 0; } during compilation it gives warning WHY ? what wrong i had done in char d[10] ? warning: … Continue reading
anybody attempted it?
printf(“%d%d%d\n”,i,i+1,i+2); Why the output is in -ve for i+1 and i+2? 2147483647 – 2147483648 -2147483647