Write a program that reads a dynamic array of 40
integers and displays only even integers
Answers were Sorted based on User's Feedback
Answer / guest
logic is:
for(i=0;i<40;i++)
{
if(a[i]%2==0)
{
printf("%d",a[i]);
}
}
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / mohammedayub.y(c.i.e.t)
#include<stdio.h>
#include<conio.h>
void main()
{
int Array[40],i;
printf("Enter the array elements one by one:\n");
for(i=0;i<40;i++)
{
scanf("%d",&Array[i]);
}
printf("The even integers are:\n");
for(i=0;i<40;i++)
{
if(Array[i]%2==0) printf("%d\n",Array[i]);
}
getch();
}
| Is This Answer Correct ? | 2 Yes | 1 No |
how to concatenate the two strings
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
Is it possible to type a name in command line without ant quotes?
main ( ) { static char *s[ ] = {“black”, “white”, “yellow”, “violet”}; char **ptr[ ] = {s+3, s+2, s+1, s}, ***p; p = ptr; **++p; printf(“%s”,*--*++p + 3); }
void main() { while(1){ if(printf("%d",printf("%d"))) break; else continue; } }
main() { int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }
#define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr()); }
Write a C function to search a number in the given list of numbers. donot use printf and scanf
C statement to copy a string without using loop and library function..
how to return a multiple value from a function?
main(){ int a= 0;int b = 20;char x =1;char y =10; if(a,b,x,y) printf("hello"); }
abcdedcba abc cba ab ba a a