struct abc{ char ch; }; printf(“%d”,sizeof(abc));//prints 1 byte but struct abc { int i; struct a{ char ch; }; }abc; printf(“%d”,sizeof(abc));//prints only 4 bytes but if we define the variable for struct a then it prints the size along with … Continue reading
for(i=0;i<n;i++) { k = k + 1; }
Functions in C language are very similar to mathematical functions. As we know: y = f(x) = 2x + 1 so for x = 0; f(x) = 2*0 + 1 = 1 i.e., y = 1 which gives an integer … Continue reading
completed with decryption …….and will work on file io……..
Ajay: Works on arrays, to making a master array from a simple array.And data-types of arrays is character(char) further continue… Harshvardhan Singh: Initial problem solution(correctness),algorithm design and flow chart design concerning the TIME & SPACE trade-off.INITid design of the code … Continue reading
when i write the statement – printf(“hello\r..jackie\n..jp\n”); it gives the o/p ..jackie ..jp but when i write the statement – printf(“hello\n..jackie\r..jp\n”); it gives the o/p hello ..jpckie why????
printf format specification: %[flag][width][.precision][modifier]<type> meaning of fields with e.g.,: format output 1. flag: printf(“%d7s”,”hello”); spacespacehello 2. width: prinf(“%4d”,10); spacespace10 3. precision: (“%.2f”,1.1412); 1.41 4. modifier: h interpreted as short used with i,d,o,u,x l interpreted as long used with i,d,o,u,x L interpreted … Continue reading
read the following code: main() { int *p,a[5]={1,2,3,4,5}; for(p=a;p<&a[5];p++) { *p=p-a; printf(“%d “,*p); } return 0; } theoretical output= 0 4 8 12 16 compiler output=0 1 2 3 4 question: Why p++ (increment in address of p) increments the … Continue reading
I am trying to pad two characters in num and trying to print the num in bit pattern.But I am getting -1 instead of 1; Output is for 65 – it should be 01000001 but i am getting 0-100000-1 sample … Continue reading