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 |
int x=sizeof(!5.856); What will value of variable x?
Why c is known as a mother language?
Can you mix old-style and new-style function syntax?
while initialization of array why we use a[][2] why not a[2][]...?
i want to make a program in which we use input having four digits(4321) and get output its reciprocal(1234).
What are local and global variables?
How pointer is benefit for design a data structure algorithm?
What is wild pointer in c?
What is else if ladder?
What is meant by preprocessor in c?
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
What is include directive in c?