0

Hiz well i m new in here n i m goin to have exam after 3 days :S i got stuckd in a question
Q) Write a program to print the product of even numbers.....

plz i m new with c langauge :S n i m having final exam jst after 3 DAys :S
thnx

5
Contributors
7
Replies
8
Views
10 Years
Discussion Span
Last Post by sweetleaf
0

Actually i havent started yet......i saw the question in exercise n i didnt found any example in my book....so thats y i asked it here

0

This will show the even integers between 2 and limit, then it is up to you to show the product:

#include <stdio.h>

int main()
{
  int x;
  int limit = 30;
  
  for(x = 2; x <= limit; x=x+2)
  {
    printf("%d\n", x);
  }
  
  getchar();  // wait for enter
  return 0;
}
0

but tis showing 143254346436 :S lolz ,..........i mean some numbers.......:S

0

well after this u only have to print the product so create a new variable long prefferably to store x*x and print tht outside the loop

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.