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

What is scanf () in c?

1054


What does void main return?

1065


Explain how can you be sure that a program follows the ansi c standard?

1397


What is d scanf?

1025


What is a dynamic array in c?

1070


What is sorting in c plus plus?

923


main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }

1446


Explain what does the function toupper() do?

1005


What is a program flowchart and explain how does it help in writing a program?

1224


What is the best way to comment out a section of code that contains comments?

1261


What is unsigned int in c?

932


What are the valid places to have keyword “break”?

1037


How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?

975


When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd

1008


Write a program to find factorial of a number using recursive function.

1063