Question: WRITE OUTPUT OF THE FOLLOWING CODES + Write down the output of the following code Code Output 3. int main() { char str1[]=string: char str2[8];

WRITE OUTPUT OF THE FOLLOWING CODES

WRITE OUTPUT OF THE FOLLOWING CODES + Write down the output of

the following code Code Output 3. int main() { char str1[]="string": char

str2[8]; strcpy(str2,str1); strcat(str2," helps in programming"); printf("%s",str2); return 0; } 4. int

+ Write down the output of the following code Code Output 3. int main() { char str1[]="string": char str2[8]; strcpy(str2,str1); strcat(str2," helps in programming"); printf("%s",str2); return 0; } 4. int main() { char country[]="Pakistan"; char *ptr; ptr=country; while(*ptr != '\0') { printf("%c", *ptr); ptr++; } return 0; } C H 5. #include struct foo { int i; float ft; int main() { foo f; f.i = 4; f.ft = 7.96623; printf("%d %.2f", f.i, f.ft); return 0; } 6. #include int main() { struct bitfields { int bits_1; int bits_2; int bits_3; float bits_4; }bit; printf("%d", sizeof(bit)); return 1; } 7. #include int main() { struct food int a; struct foo obj1={1}; struct foo obj2 = obj1; printf("%d", obj2.a); obj2.a = 100; printf("%d", obj1.a); return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!