Programming in C
Description: Programming in C | |
Number of Questions: 5 | |
Created by: Blackmamba | |
Tags: |
Find out the output of the given program or error if any.
static int i=10;
int main()
{
i=25; // line 4
printf(%d,i);
return 0;
}
Find out the output of the given program or error if any.
int main()
{
void swap (int*,int*); //Line 4
int a=10,b=20;
swap(&a,&b); //Line 6
printf(%d,%d,a,b);
getch();
}
void swap( int* x, int* y) //Line 9
{
int temp=*x; //Line 10
*x=*y; //Line 11
*y=temp; //line 12
}
What will be the output of the given program or find out the error if any?
int main()
{
float x=fun(2,3);
printf(%f,x);
}
int fun (int x,float y) //Line 7
{
x = 20.9; //Line 9
return x;
}
Find out the output of the given program or error if any.
static int i=10;
i=20;
int main()
{
printf(%d,i);
return 0;
}
Find out the output of the given program or error if any.
int main()
{
register int n;
int i;
printf(Enter the no. of loops to run:);
scanf(%d,&n);
for (i=0;i < n;i++)
{
printf(%d\\n,i);
}
}