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 / 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 |
Program to find largest of three numbers without using comparsion operator?
what is the other ways to find a logic to print whether a number is an even or odd wit out using % symbol??????? i know three different ways to print it. so i need any other different logic>>>>>
Write a program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors
Tell me the use of bit field in c language?
Which is best book for data structures in c?
Explain two-dimensional array.
Can you define which header file to include at compile time?
What are the application of c?
Should a function contain a return statement if it does not return a value?
What is the scope of local variable in c?
What is I ++ in c programming?
Is it possible to create recycle bin in mobiles?