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 |
How can I pad a string to a known length?
Write a c program to read a positive number and display it in words.? ex: 123=one two three help me....
we all know about the function overloading concept used in C++ and we all learnt abt that.... but that concept is already came in C in a very smaller propotion ... my question is IN WHICH CONCEPT THERE IS A USE OF FUNCTION OVERLOADING IS USED in C language?????????????
what is difference between c and c++
what is call by value and call by reference
What are pointers really good for, anyway?
what are the 10 different models of writing an addition program in C language?
print out put like this form 1 2 3 4 5 6 3 5 7 9 11 8 12 16 20
What is use of pointer?
Write a program to check prime number in c programming?
How do I copy files?
How can I access a memory located at certain address?