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
Can we declare variables anywhere in c?
What is property type c?
What is the use of sizeof () in c?
Does c have class?
what are non standard function in c
What is array in c with example?
Why do we use int main instead of void main in c?
What is malloc return c?
What is an array in c?
How can I call fortran?
Explain how many levels deep can include files be nested?
the question is that what you have been doing all these periods (one year gap)
Explain how can I manipulate strings of multibyte characters?
we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above
How can I remove the trailing spaces from a string?