Synovate

www.synovate.com
Profile Unclaimed

Interview Question

Survey Programmer Interview Sofia (Bulgaria)

Q1: How will you count the number of ALL numbers up to

  100 which are even?
Answer

Interview Answer

1 Answer

0

#include<iostream.h>
#include<conio.h>
void main()
{
int c=0;
for(int i=0;i<100;i++)
{
if(i%2==0)
c++;
}
cout<<"the total no of even no;s are"<<c;
getch();
}

Anonymous on Jun 18, 2012

Add Answers or Comments

To comment on this, Sign In or Sign Up.