#include int main() { std::printf(“Strings:\n”); const char* s = “Hello”; std::printf(“\t.%10s.\n\t.%-10s.\n\t.%*s.\n”, s, s, 10, s); std::printf(“Characters:\t%c %%\n”, 65); std::printf(“Integers\n”); std::printf(“Decimal:\t%i %d %.6i %i %.0i %+i %u\n”, 1, 2, 3, 0, 0, 4, -1); std::printf(“Hexadecimal:\t%x %x %X %#x\n”, 5, 10, 10, … Continue reading
I had complete assignment question up to 10. and got some problem in this question.
I had complete assignment question up to 23. & got some problem in this question. 6,26.
i had complete assignment qs up to 11. int x=1; printf(“\n %d”,~x|x); output : -1
what is the meaning of %8g in c language?
Can anyone tell me what is the difference between i++ and ++i w.r.t compiler in C
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
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(“%7s”,”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 as … 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
I am performing file read and write operations everything is working fine but my function is not checking EOF. It is not coming out of loop even if i had applied a condition (if character is equal to EOF ). … Continue reading