Advertisements
Advertisements
Question
Correct the following code sigment:
if (x = 1)
p = 100;
else
p = 10;
Chart
Solution
Given Code | Corrected Code |
if (x = 1) p = 100; else p = 10; |
if(x == 1) |
shaalaa.com
Statements
Is there an error in this question or solution?
APPEARS IN
RELATED QUESTIONS
What is the alternate name of the null statement?
In C++, the group of statements should be enclosed within: ______
Identify the odd one from the keywords of jump statements?
What are a null statement and compound statement?
Compare an if and a ? : operator.
Write a program to find the LCM and GCD of two numbers.
Write a program to find sum of the series
S = 1 + x + x2 +..... + xn