+ 1

Hey guys am trying to write a program that accepts a variable and uses an if statement

The program is to increase the value of the input by 5 if it's a multiple of 3 and reduce it by 3 if it's not. Can anyone help me am stuck. Don't know what to do next.or how to input the if statement

4th Oct 2019, 12:19 PM
Anecho Jeremy Stewart
Anecho Jeremy Stewart - avatar
4 Respuestas
+ 3
#include<stdio.h> int main() { int input; Scanf("%d",&input); if(input%3==0) input=input+5; else input=input-3; }
4th Oct 2019, 12:53 PM
Nandini
0
It's a C program
4th Oct 2019, 12:19 PM
Anecho Jeremy Stewart
Anecho Jeremy Stewart - avatar
0
Can't seem to work. are there possible ways of getting to the same result even.
5th Oct 2019, 12:19 PM
Anecho Jeremy Stewart
Anecho Jeremy Stewart - avatar
0
#include<stdio.h> int main() { int input; Scanf("%d",&input); if(input%3==0) input=input+5; else input=input-3; }
7th Dec 2019, 6:40 AM
Kaviyarasan R