a)100
b)200
c)300
print a+b if c=300
print a-b if c=300
can someone help?how i do this?
a)100
b)200
c)300
print a+b if c=300
print a-b if c=300
can someone help?how i do this?
Perhaps you should start by writing a program that defines a variable named a and prints a. Then, extend the program to define a variable named b and prints a + b. Then, extend the program to define a variable named c, and if c == 300, print a + b and a - b.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Code:#include <stdio.h> int main (){ int a=100,b=200,c=300; if ("c==300"); if ("c==300"); printf("a-b\n"); printf("a+b\n"); return 0; }
like this?
No. You need to read your notes.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)