I need help with this
Write a program that will get a number from user and print ""Hello world" that time. But remember if the entered number is even then the program should add 1 to that value and print the value that times and your program should only print the output odd times.
E.g. If user entered 2 or any even value then add 1 to that value and print the string that times and also show a beep at last output if and only if the entered value is even.


my code
Code:
#include<iostream.h>
#include<conio.h>
void main()
{
int num;
clrscr();
cout<<"\n How many times do you want to print Hello World ?  ";
cin>>num;
for(int i=1;i<=num;i++)
	{
	if(num%2==0)
	num+=1;     //this will increment if num is even
	cout<<"\n Hello World ";
	}
         cout<<"\a";
getch();
}
I cant do the beep part if the num is even. Though it does gives u beep at the end wether if its even or odd...