1)what is the error in the following stmt where str is a
char array and the stmt is supposed to traverse through the
whole character string str?
for(i=0;str[i];i++)
a)There is no error.
b)There shud be no ; after the stmt.
c)The cond shud be str[i]!='\0'
d)The cond shud be str[i]!=NULL
e)i shud be initialized to 1
Answer Posted / rajesh
options A and C are correct....
Check it in C programming online editor www.codepad.org
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
Is it better to use a macro or a function?
Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.
What are control structures? What are the different types?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
Which header file should you include if you are to develop a function which can accept variable number of arguments?
How many types of functions are there in c?
What is data structure in c programming?
Explain the properties of union. What is the size of a union variable
What is the difference between NULL and NUL?
Tell me when would you use a pointer to a function?
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
What are the disadvantages of a shell structure?
What does 1f stand for?
Explain what is the use of a semicolon (;) at the end of every program statement?