Which of the following escape sequence represents carriage return?
The format identifier '%i' is also used for which data type?
When does the diamond problem occur in C++?
Comment on the output of this C code?
void main()
{
int k = 8;
int m = 7;
int z = k < m ? k = m : m++;
printf("%d", z);
}
What will be the output of the following C code?
#include <stdio.h>
void m() {
printf("hi");
m();
}
int main() {
m();
return 0;
}
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
char arr[20];
int i;
for(i = 0; i < 10; i++)
*(arr + i) = 65 + i;
*(arr + i) = '\0';
cout << arr;
return(0);
}
What is implicit type conversion?
What will be the output of the following C++ code?
#include <iostream>
#include <cctype>
using namespace std;
int main(int argc, char const *argv[])
{
char arr[12] = "Hello World";
for(int i=0;i<12;i++)
{
cout<<(bool)isalpha(arr[i]);
}
}
Which of the following statements is true?
1. A hash function takes a message of arbitrary length and generates a fixed-length code.
2. A hash function takes a message of fixed length and generates a code of variable length
3. A hash function may give the same hash values for distinct messages