Q1. Point out the error if any in the for loop
void main()
{
int i=1;
for(;;)
{
printf("%d",i++);
if(i>10)
break;
}
}
void mai()
{
while(-10)
printf('Hello\t");
}
void main()
{
int i;
for(i=0;i;i++)
printf(" %d ",i);
}
void main()
{
int i;
for(i=1;i<=10;i++);
printf("%d",i);
}
void main()
{
int num,r=1;
for(printf('Enter a number "),scanf("%d",&num);num;r=r*num,num--);
printf(" r = %d ", r);
}
suppose the user entered 5.
void main()
{
int arr[] = { 1,2,3,4,5};
arr++;
printf(" address of arr = %u",arr);
}
Suppose the starting address of the array is 1000
void main()
{
int a,b;
a=3;
b=5;
a= b++ + b++ + ++b + ++b + b++ + --b + ++b;
printf( "a= %d b = %d",a,b);
}
void main()
{
int a,b,c;
a=10;
b=20;
c=30
a^=b^=c^=b;
printf(" a= %d , b= %d" c= %d ",a,b,c);
}
void main()
{
int a=10,b=20,c=30;
printf( %d %d %d");
}