How to count a sum, when the numbers are read from stdin and
stored into a structure?
Answer / pavan_mustyala
/**********
First construct the structure with total count on numbers
to be added. Now these members are accessed via that
structure variables. In the below example, structure
contains 2 numbers only.
***********/
#include <stdio.h>
struct numbers
{
int num1;
int num2;
};
void main()
{
struct numbers mpk;
int result;
printf("Enter two numbers");
scanf("%d%d",&mpk.num1, &mpk.num2);
result = mpk.num1 + mpk.num2;
}
Is This Answer Correct ? | 1 Yes | 0 No |
Is the following statement a declaration/definition. Find what does it mean? int (*x)[10];
#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d----%d",*p,*q); }
How can i find first 5 natural Numbers without using any loop in c language????????
Cluster head selection in Wireless Sensor Network using C programming language.
main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }
main() { char s[ ]="man"; int i; for(i=0;s[ i ];i++) printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]); }
Write, efficient code for extracting unique elements from a sorted list of array. e.g. (1, 1, 3, 3, 3, 5, 5, 5, 9, 9, 9, 9) -> (1, 3, 5, 9).
13 Answers Intel, Microsoft, TCS,
Sorting entire link list using selection sort and insertion sort and calculating their time complexity
1 Answers Infosys, Microsoft, NetApp,
main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above
Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange
how to return a multiple value from a function?
String copy logic in one line.