-
Faster Statement Execute
Which one will execute faster if(flag==0) or if (0==flag) and why?
-
Declare Array of N Pointers
How do you declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
-
Declare an array of N pointers
How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
-
How do you loop a program to display your name however times you want it to.
and to display " Hello %s!! Do you want to try again [Y/N]? "
-
Difference between printf and cprintf
What is the difference between cprintf and printf? Please explain in detail.
-
What change is required in the following program so that its output becomes 3,6,11,20,37,......1034?
c#include
#include
int main()
{
int a=1,r=2,i;
for (i=0;iWhat will be output if you will execute following c code?
c #i ain()
{
float p=1,q=2,r=-2,a;
a=avg(p,(q=4,r=-12,q),r);
printf("%f",a); return 0;
}
float avg(float x,float y,float z)
{
return (x+y+z)/3;
}
a) 1.000000
b) 0.333333
c) -2.333333
d) 1Program to print all prime numbers btw 1 to 100
C Program to print all prime numbers btw 1 to 100..pls explain the program: What is if(p)??cpp#include
#include
int main()
{
int num,n,div,p;
printf("Enter any number: ");
scanf("%d", &num);
for(n=2; nOutput for following and explanation
j=scanf("%d",&i);
printf("%d",j);What is the benefit of using #define to declare a constant?
Using the #define method of declaring a constant enables you to declare a constant in one place and use it throughout your program. This helps make your programs more maintainable, because you need to maintain only the #define statement and not several instances of individual constants throughout your program. For instance, if your program used the value of pi (approximately 3.14159) several...
How can I convert a number to a string?
The standard C library provides several functions for converting numbers of all formats (integers, longs, floats, and so on) to strings and vice versa The following functions can be used to convert integers to strings: Function Name Purpose itoa() Converts an integer value to a string. ltoa() Converts a long integer value to a string. ultoa() Converts an unsigned long integer value to a string....
Which expression always return true? Which always return false?
expression if (a=0) always return false expression if (a=1) always return true
Main(int argc, char *argv[]) { (main && argc) ? main(argc-1, NULL) : return 0; }
A) Gets into Infinite loopB) Compile error. Illegal syntaxC) None of the aboveD) Runtime error.Explanation: illegal syntax for using return
Main(){ char * strA; char * strB = I am OK; memcpy( strA, strB, 6);}
A) Compile errorB) I am OKC) Runtime error.D) I am OExplanation: I am OK is not within " "
Ans