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
Are local variables initialized to zero by default in c?
What is string length in c?
What do header files do?
What is line in c preprocessor?
What the different types of arrays in c?
find out largest elemant of diagonalmatrix
What are the types of macro formats?
How do you do dynamic memory allocation in C applications?
What is static memory allocation? Explain
What is maximum size of array in c?
Difference between linking and loading?
What is "Duff's Device"?
Is file a keyword in c?
Write a program of advanced Fibonacci series.
What language is windows 1.0 written?