If 4 digits number is input through the keyboard, Write a
program to calculate sum of its 1st & 4th digit.
Answer Posted / akhiltelaprolu
#include<stdio.h>
main()
{
int n,a[20],b[20],i,j;
for(i=0;i<n;i++)
scanf("%d",&a[i]);
i=0;
for(j=0;j<n/2;j++)
{
b[j]=a[i]+a[n-1];
i++;
n=n-1;
}
for(j=0;j<n/2;j++)
printf("%d",b[j]);
if(n%2!=0)
printf("%d",a[n/2]):
}
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
What is the symbol indicated the c-preprocessor?
In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.
What is the difference between ++a and a++?
What are the different properties of variable number of arguments?
how should functions be apportioned among source files?
What is the difference between struct and union in C?
What are the basic data types associated with c?
Can a local variable be volatile in c?
What is meant by gets in c?
Difference between MAC vs. IP Addressing
Explain what is the benefit of using #define to declare a constant?
How does #define work?
What is hashing in c?
What is d scanf?
what is the significance of static storage class specifier?