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 |
Is array a primitive data type in c?
How to reverse a linked list
1 Answers Aricent, Fidelity, IBM, TCS,
Diff: between this 2 classes in terms of memory class A { int i; char c; double d; }; class A { double d; int i; char c; }; How it is calculating?
Where static variables are stored in c?
What is the difference between declaring a variable by constant keyword and #define ing that variable?
What does d mean?
what is a far pointer
12 Answers ABB, DRDO, ITI, Maruti Suzuki, Steel Plant, TCS, Toyota, Vivo Mobiles,
sir i got 146 correct question & i have also the advantage of height so will they consider my marks as 146+3=149.can any body tell me how they consider my height marks.
what is the self-referential structure?
Differentiate between a structure and a union.
What are formal parameters?
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.