Write a c program to print the even numbers followed by odd
numbers in an array without using additional array
Answer / nitin garg
#include <stdio.h>
#include <conio.h>
#include <string.h>
int main()
{
int num[100],n,i,j;
printf("how many elements you enter
");
scanf("%d",&n);
printf("Enter %d elements
",n);
for(i=0;i<n;i++)
{
scanf("%d",&num[i]);
}
printf("
print the even numbers followed by odd
numbers
");
for(i=0;i<n;i++)
{
if(num[i]%2==0 && num[i+1]%2!=0)
printf("%d
",num[i]);
}
getch();
}
Output:
how many elements you enter
10
Enter 10 elements
2
4
6
8
10
12
14
16
18
19
print the even numbers followed by odd
numbers
18
| Is This Answer Correct ? | 0 Yes | 1 No |
where do we use volatile keyword?
f1() { f(3);} f(int t) { switch(t); { case 2: c=3; case 3: c=4; case 4: c=5; case 5: c=6; default: c=0;} value of c?
Mention four important string handling functions in c languages .
write a reverse string to print a stars.(with out using logic) ***** **** *** ** *
Explain how do you override a defined macro?
what is data structure
write a program for 7*8 = 56 ? without using * multiply operator ? output = 56
What is a shell structure examples?
Derive the complexity expression for AVL tree?
a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
What are the types of data types and explain?