|
| Total Answers and Comments: 2 |
Last Update: June 06, 2007 |
|
| | |
|
No best answer available. Please pick the good answer available or submit your answer. |  Which of the following about automatic variables within a function is correct ?a.its type must be declared before using the variableb.they are localc.they are not initialised to zerod.they are global. C
Write one statement equivalent to the following two statementsx=sqr(a);return(x);Choose from one of the alternativesa.return(sqr(a));b.printf("sqr(a)");c.return(a*a*a);d.printf("%d",sqr(a)); D
Which of the following about the C comments is incorrect ?a.commentscan go over multiple linesb.comments can start any where in the linec.a line can contain comments with out any language statementsd.comments can occur within comments C
What does the following function print?func(int i){if(i%2)return 0;eale return 1;}main(){int =3;i=func(i);i=func(i);printf("%d",i);}a.3b.1c.0d.2 C
A memory of 20 bytes is allocated to a string declared as char *sthen the following two statements are executed:s="Etrance"l=strlen(s);what is the value of l ?a.20b.8c.9d.21 C
Consider the following structure:struct num nam{int no;char name[25];};struct num nam n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}};..........printf("%d%d",n1[2],no,(*(n1 Consider the following structure:struct num nam{int no;char name[25];};struct num nam n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}};..........printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1);What does the above statement print?a.8,9b.9,9c.8,8d.8,unpredictable value C A Latest Answer : answer is 5 times ...
# define prod(a,b)=a*bmain(){int x=2;int y=3;printf("%d",prod(x+2,y-10)); }the output of the program is a.8b.6c.7d.none A
Find the output of the following programmain(){int x=5, *p;p=&x;printf("%d",++*p);}a.5b.6c.0d.none B
Which of the following statements is incorrecta.typedef struct new{int n1;char n2;} DATA;b.typedef struct {int n3;char *n4; }ICE;c.typedef union {int n5;float n6;} UDT;d.#typedef union {int n7;float n8;} TUDAT; B
C++ Memory Management operators | |
C Memory Management operators Need for Memory Management operators The concept of arrays has a block of memory reserved The disadvantage with the concept of arrays is that the programmer must know while programming the size of memory to be allocated in addition to the array size remaining constant m |
|
C++ String Representation and Handling | |
C String Representation and Handling In this C tutorial you will learn about string representation and handling how is string represented end string notation initializing char array character representation string literals example programe to understand the character array concept and the accessing |
|
C++ Decision Making Statements | |
C Decision Making Statements In this C tutorial you will learn about decision making statements if statement if… else statement switch statement conditional operator along with syntax and examples mosgoogle center Decision making is an important concept in any programming language and to |
|
JavaScript String Object | |
JavaScript String Object In this JavaScript tutorial you will learn about String Object purpose of string object in JavaScript purpose of string object indexof method lastIndexOf method and substring method along with syntax and example mosgoogle center Purpose of String Object in JavaScript The mai |
|
Convert a String into an Integer | |
How to convert a string into an integer in C program?
This is done by using the function named as atoi(). This function atoi() is present in the header file named as <stdlib.h>. When programmers use this function they must include the header file by the statement
#include <stdl |
|
String handling functions | |
What is the string handling functions present in header file <string.h>?
There are number of string handling functions present in string.h. In other words if a programmer uses any of the function present in string.h then they must include the header file as
#include <string.h&am |
|
Convert a String into Long Value | |
What string function is used to convert a string into long value?
This is done by using the function named as atol() . This function atol() is present in the header file named as <stdlib.h>. When programmers use this function they must include the header file by the statement
|
|
How is the main() function declared? | |
The declaration of main can be done as
int main()
One more declaration that can be taken by main is command line arguments form
int main(int argc, char *argv[])
or this can also be written as
int main(argc, argv)
int argc;
char *argv[];
NOTE: It is not possible for one to declare the main |
|
What happens when a variable is not declared in function definition? | |
Generally in C program the function definition and calling takes the form as given below:
main()
{
int x,y,z;
z=sample(x,y);
printf(“%d”,z);
}
sample(x1,y1)
int x1,y1;
{
int z1;
z1= x1 - y1;
return(z1);
}
Here what happens is the values x, y gets passed to x1,y1 |
|
Base Address of the String | |
What happens when we try to change the value of base address of the string?
The base address of the sting takes a special place in the context of strings. This is because suing this base address only the string gets identified. In other words the base address therefore takes the position of constant |
| |
|