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 |
#define prod(a,b) a*b main() { int x=3,y=4; printf("%d",prod(x+2,y-1)); }
Write a C function to search a number in the given list of numbers. donot use printf and scanf
Is the following code legal? typedef struct a { int x; aType *b; }aType
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal.
6 Answers Fusion Systems GmbH,
#ifdef something int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }
Printf can be implemented by using __________ list.
Implement a t9 mobile dictionary. (Give code with explanation )
1 Answers Amazon, Peak6, Yahoo,
How to use power function under linux environment.eg : for(i=1;i<=n;i++){ pow(-1,i-1)} since it alerts undefined reference to 'pow'.
Write a program to implement the motion of a bouncing ball using a downward gravitational force and a ground-plane friction force. Initially the ball is to be projected in to space with a given velocity vector
can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail
write a c program to print magic square of order n when n>3 and n is odd?
main() { int x=5; clrscr(); for(;x==0;x--) { printf("x=%d\n”", x--); } } a. 4, 3, 2, 1, 0 b. 1, 2, 3, 4, 5 c. 0, 1, 2, 3, 4 d. none of the above