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.
Answer / ram
#include<stdio.h>
#define M 3
main()
{
int i,a[M];
for(i=0;<M;i++)
a[i]=i*10;
for(i=0;<M;i++)
printf("%d ",a[i]);
}
Is This Answer Correct ? | 0 Yes | 0 No |
main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("\n %u %u ",j,k); }
Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange
main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit = (bit >> (i - (i -1)))); } } a. 512, 256, 128, 64, 32 b. 256, 128, 64, 32, 16 c. 128, 64, 32, 16, 8 d. 64, 32, 16, 8, 4
What is the subtle error in the following code segment? void fun(int n, int arr[]) { int *p=0; int i=0; while(i++<n) p = &arr[i]; *p = 0; }
main() { int y; scanf("%d",&y); // input given is 2000 if( (y%4==0 && y%100 != 0) || y%100 == 0 ) printf("%d is a leap year"); else printf("%d is not a leap year"); }
how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns
main() { char not; not=!2; printf("%d",not); }
Give a oneline C expression to test whether a number is a power of 2?
25 Answers EA Electronic Arts, Google, Motorola,
main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }
int DIM(int array[]) { return sizeof(array)/sizeof(int ); } main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr)); }
How to read a directory in a C program?
How to count a sum, when the numbers are read from stdin and stored into a structure?