Which version do you prefer of the following two,
1) printf(“%s”,str); // or the more curt one
2) printf(str);
Answer / susie
Answer : & Explanation:
Prefer the first one. If the str contains any format
characters like %d then it will result in a subtle bug.
| Is This Answer Correct ? | 3 Yes | 0 No |
can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail
Write a program using one dimensional array to assign values and then display it on the screen. Use the formula a[i]=i*10 to assign value to an element.
1 Answers Samar State University,
Program to find the largest sum of contiguous integers in the array. O(n)
posted by surbhi just now main() { float a = 5.375; char *p; int i; p=(char*)&a; for(i=0;i<=3;i++) printf("%02x",(unsigned char) p[i]); } how is the output of this program is :: 0000ac40 please let me know y this output has come
#define SQR(x) x * x main() { printf("%d", 225/SQR(15)); } a. 1 b. 225 c. 15 d. none of the above
struct Foo { char *pName; char *pAddress; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); obj->pName = malloc(100); obj->pAddress = malloc(100); strcpy(obj->pName,"Your Name"); strcpy(obj->pAddress, "Your Address"); free(obj); printf("%s", obj->pName); printf("%s", obj->pAddress); } a. Your Name, Your Address b. Your Address, Your Address c. Your Name Your Name d. None of the above
/*what is the output for*/ void main() { int r; printf("Naveen"); r=printf(); getch(); }
How can you relate the function with the structure? Explain with an appropriate example.
Write a routine to implement the polymarker function
write a program to find out roots of quadratic equation "x=-b+-(b^2-4ac0^-1/2/2a"
main() { int i = 3; for (;i++=0;) printf(“%d”,i); }
#include<stdio.h> #include<conio.h> void main() { int a=(1,2,3,(1,2,3,4); switch(a) { printf("ans:"); case 1: printf("1");break; case 2: printf("2");break; case 3: printf("1");break; case 4: printf("4");break; printf("end"); } getch(); }