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 |
union u { struct st { int i : 4; int j : 4; int k : 4; int l; }st; int i; }u; main() { u.i = 100; printf("%d, %d, %d",u.i, u.st.i, u.st.l); } a. 4, 4, 0 b. 0, 0, 0 c. 100, 4, 0 d. 40, 4, 0
pls anyone can help me to write a code to print the values in words for any value.Example:1034 to print as "one thousand and thirty four only"
Write a program using one dimensional array to assign values and then display it on the screen. Use the formula a[i]=i*10 to assign value to an element.
1 Answers Samar State University,
programming in c lanugaue programm will errror error with two header file one as stdio.h and other one is conio.h
In the following pgm add a stmt in the function fun such that the address of 'a' gets stored in 'j'. main(){ int * j; void fun(int **); fun(&j); } void fun(int **k) { int a =0; /* add a stmt here*/ }
how can i search an element in an array
2 Answers CTS, Microsoft, ViPrak,
How to read a directory in a C program?
WAP to display 1,2,3,4,5........N
C statement to copy a string without using loop and library function..
respected sir, i did my MCA in 2013 when i am going to attend to an interview i was asked about my project how will i explain my project could please help me in this and my project title is "Social Networking Site For Social Responsibility"
main() { int *j; { int i=10; j=&i; } printf("%d",*j); }
What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql