Skip to main content

Find Sum of even and odd in a series of numbers.

PROCEDURE:-
      1.enter an integer value n, set oddsum and evensum to 0
      2. repeat step 3 and 4 until  all the n different values are read
      3.read an integer find modulo 2 of that if result is 0 add this to previous evensum
      4.if result of modulo is 1 add the integer to previous oddsum
      5.print the oddsum and evensum
CODE:-

#include<stdio.h>
void main()
{
  int n,x,i=1;sume=0,sumo=0;
  printf(“enter value for n”);
  scanf(“%d”,&n);
  printf(“enter %d different values”,n);
  while(i<=n)
  {
    scanf(“%d”,&x);
    if(x%2= =0)
      sume=sume+x;
    else
      sumo=sumo+x;
    i++
  }
printf(“Even sum =%d \n Odd sum = %d”, sume,sumo);
}


Input:- enter value for n 4
               enter 4 different values  10 11 12 13
Output:- Even sum =22  Odd sum =24
 

Comments

Popular posts from this blog

Hide your IP address with Proxy servers

The most common method to Hide your IP address is to use a PROXY server. Proxy server is a computer network service that provides an indirect connections between other computer networks. By using this proxy sites we can access any website with out revealing our IP address. This is the best method to keep your IP address secure. Here is the free proxy server website link.  http://www.freeproxyserver.ca/     We need to type the URL of such as (www.facebook.com) in the box given in the site, then we can browse it with out providing our IP address

Future Mouse-Evo Mouse

New evolution of the Mouse. In 1980's round ball mouses are invented, then technology introduced Optical mouses. Now upcoming Mouse is named as Evo mouse . No more movement of your hands on placing a physical mouse,   Your finger is the pointer . You can use this mouse on any Flat Surface and also it requires very little space. This mouse contains a Power button on the top, Mini USb port . It works with the help of bluetooth and input is taken by the sensor. View this Video to know the functionality of   EvoMouse

ALIENS RESEARCH CENTRE

Area 51 This is a never ending debate. Do aliens really exist? Does any one have proof that aliens exist? There has been now official confirmation from the Government and NASA that they have proof that aliens exist.  Biggest proof that aliens exist is the collection of alien pictures from NASA’s own system and also footages of sound and movement that have recorded such unusual happenings. How long can we now deny the truth of proof that aliens exist? A video that is a proof to prove the exitence of aliens.  Area 51  is a  military base , and a remote detachment of  Edwards Air Force Base . It is located in the southern portion of  Nevada  in the western  United States . It is the place were the research is going on the existence of aliens. A UFO(unidentified flying object) is crashed in Area 51 on july 1947.