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 |
1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates.
19 Answers Amazon, BITS, Microsoft, Syncfusion, Synergy, Vector,
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }
main() { struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }
main() { main(); }
Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines
#define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr()); }
main() { printf("%d", out); } int out=100;
Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like.
21 Answers ABC, eBay, Goldman Sachs, Google, HUP, Microsoft, TATA,
char *someFun1() { char temp[ ] = “string"; return temp; } char *someFun2() { char temp[ ] = {‘s’, ‘t’,’r’,’i’,’n’,’g’}; return temp; } int main() { puts(someFun1()); puts(someFun2()); }
how to concatenate the two strings