C Programming and Technical Programming Basics

Consider the following code:

for i= m to n increment 2
{ print "Hello!" }

Assuming m < n and exactly one of (m,n) is even, how many times will Hello be printed?
Option 1 : (n - m + 1)/2
Option 2 : 1 + (n - m)/2
Option 3 : 1 + (n - m)/2 if m is even, (n - m + 1)/2 if m is odd
Option 4 : (n - m + 1)/2 if m is even, 1 + (n - m)/2 if m is odd

Read Solution (Total 3)

C Other Question

integer i = 0 
integer sum = 0 
while ( i <= 50 ) 

sum = sum + i 
-- MISSING STATEMENT 5 -- 

print sum 
main()
{
int a[3][4]={(5,7,5,9),(4,6,3,1),(2,9,0,6)};
int *p;
int (*q)[4];
p=(int *)a;
q=a;
printf("n%u%u",p,q);
p++;
q++;
printf("n%u%u",p,q);
}