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 dynamic dispatch in c++?
hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..
Are enumerations really portable?
The program will first compute the tax you owe based on your income. User is prompted to enter income. Program will compute the total amount of tax owed based on the following: Income Tax 0 - $45,000 = 0.15 x income $45,001 - $90,000 = 6750 + 0.20 x (income – 45000) $90,001 - $140,000 = 15750 + 0.26 x (income – 90000) $140,001 - $200,000 = 28750 + 0.29 x (income – 140000) Greater than $200,000 = 46150 + 0.33 x (income – 200000) Dollar amounts should be in dollars and cents (float point numbers with two decimals shown). Tax is displayed on the screen.
Explain what will the preprocessor do for a program?
What are pointers? What are stacks and queues?
What is structure of c program?
What is pointer and structure in c?
Why header files are used?
What is static memory allocation?
Explain can static variables be declared in a header file?
How are variables declared in c?
Why & is used in scanf in c?
What is the total generic pointer type?
what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?