What is the problem in the following C declarations?
int func(int);
double func(int);
int func(float);
a) A function with same name cannot have different signatures
b) A function with same name cannot have different return types
c) A function with same name cannot have different number of parameters
d) All of the mentioned
Answer: d
Related Posts
What will be the output of the following C code?
#include < stdio.h >
static int x = 5;
void main()
{
int x = 9;
{
x = 4;
}
printf(“%d”, x);
}What will be the output of the following C code?
#include < stdio.h >
int x;
void main()
{
m();
printf(“%d”, x);
}
void m()
{
x = 4;
}What will be the output of the following C code?
#include < stdio.h >
int x = 5;
void main()
{
int x = 3;
m();
printf(“%d”, x);
}
void m()
{
x = 8;
n();
}
void n()
{
printf(“%d”, x);
}What will be the output of the following C code?
#include < stdio.h >
void main()
{
int x = 3;
{
x = 4;
printf(“%d”, x);
}
}Array sizes are optional during array declaration by using ______ keyword.
What will be the sequence of allocation and deletion of variables in the following C code?
#include < stdio.h >
int main()
{
int a;
{
int b;
}
}Comment on the following 2 C programs.
#include < stdio.h > //Program 1
int main()
{
int a;
int b;
int c;
}
#include < stdio.h > //Program 2
int main()
{
int a;
{
int b;
}
{
int c;
}
}
Join The Discussion