Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

please help me.. how to write a code of this output??

"Enter range number:"10

1 is an odd number
2 is an even numbers
3 in an odd numbers
4 "
to
10"

"printing all odd numbers:"
1,3,5,7,9
"printing all even numbers:"
2,4,6,8,10
"sum of all odd numbers:25
"sum of all even numbers:30

using a C Programming ARRAY

pleas pleas help.. its my project ..please :(

Answer Posted / mudita rathore

#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],i,sum=0,sum1=0;
printf("enter the all numbers");
for(i=0;i<10;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<10;i++)
{
if(a[i]%2==0)
{
printf("even numbers=%d\n",a[i]);
sum=sum+a[i];
printf("sumof even numbers=%d\n",sum);
}
else
{
printf("odd numbers=%d\n",a[i]);
sum1=sum1+a[i];
printf("sum of odd numbers=%d\n",sum1);
}
}
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Under what circumstances does a name clash occur?

1205


Is it possible to use curly brackets ({}) to enclose single line code in c program?

1325


Are local variables initialized to zero by default in c?

1053


Difference between constant pointer and pointer to a constant.

1155


What is pivot in c?

1031


What are the c keywords?

1207


Is null a keyword in c?

1198


Difference between strcpy() and memcpy() function?

1155


How do we print only part of a string in c?

1031


Can you subtract pointers from each other? Why would you?

963


a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion

2783


What will be the outcome of the following conditional statement if the value of variable s is 10?

1297


WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..

2082


In C programming, what command or code can be used to determine if a number of odd or even?

1062


Is c still relevant?

1088