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 |
What is "far" and "near" pointers in "c"...?
main() { int i=5,j=6,z; printf("%d",i+++j); }
what will be the output of this program? void main() { int a[]={5,10,15}; int i=0,num; num=a[++i] + ++i +(++i); printf("%d",num); }
write a c program to Create a mail account by taking the username, password, confirm password, secret_question, secret_answer and phone number. Allow users to register, login and reset password(based on secret question). Display the user accounts and their details .
#define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); }
main() { int i = 0xff ; printf("\n%d", i<<2); } a. 4 b. 512 c. 1020 d. 1024
programming in c lanugaue programm will errror error with two header file one as stdio.h and other one is conio.h
main() { char a[4]="HELLO"; printf("%s",a); }
main() { int i=5; printf("%d",++i++); }
Develop a routine to reflect an object about an arbitrarily selected plane
Program to find the largest sum of contiguous integers in the array. O(n)
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