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 |
create a C program that displays one z,two y's,three x's until twenty six A's. plzz answer i need it tomorrow.
How to removing white spces in c programming only bu using loops
What is meant by initialization and how we initialize a variable?
Difference between C and Embedded C?
using only #include <stdio.h> and #include <stdlib.h> Write a program in C that will read an input from the user and print it back to the user if it is a palindrome. The string ends when it encounters a whitespace. The input string is at most 30 characters. Assume the string has no spaces and distinguish between and lowercase. So madam is a palindrome, but MadAm is not a palindrome. Use scanf and %s to read the string. Sample Test: Enter a string: madam madam is a palindrome. Enter a string: 09023 09023 is not a palindrome.
What is c definition?
how to find the kth smallest element in the given list of array elemnts.
we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above
what r the cpu registers r ther?
. Write a program to get a string and to convert the 1st letter of it to uppercase
How do I round numbers?
what is c