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 the meaning of 2d in c?

1127


what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555

3070


Is fortran still used in 2018?

1040


A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler

1098


Can a function argument have default value?

1152


What is a buffer in c?

1003


Explain how does flowchart help in writing a program?

1119


What is struct node in c?

1075


How a string is stored in c?

1072


I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.

2232


What is the difference between variable declaration and variable definition in c?

1059


Why is c fast?

1065


How do I send escape sequences to control a terminal or other device?

1078


what is the syallabus of computer science students in group- 1?

2320


Are comments included during the compilation stage and placed in the EXE file as well?

1084