Rectify the errors in the following code and obtain the result. a,b=12,16 a,b=b,a+2 print =a, b
Answers
Answered by
3
Explanation:
tui ohh ask khorsotnii
Answered by
3
The correct statements
a=12
b=16
a=b;
b=a+2;
Explanation:
a,b=12,16 a,b=b,a+2 print =a, b
In above statements, The declaration of variables a and b is incorrect
Print =a,b is also incorrect statement.
Correct Program:
#include <stdio.h>
int main()
{
int a,b;
a=12;
b=16;
a=b;
b=a+2;
printf("a=%d b=%d ",a,b);
return 0;
}
Output:
a=16 b=18
Similar questions
English,
6 months ago
English,
6 months ago
Math,
6 months ago
Computer Science,
1 year ago
Chemistry,
1 year ago