If 4 digits number is input through the keyboard, Write a
program to calculate sum of its 1st & 4th digit.
Answers were Sorted based on User's Feedback
Answer / kadher masthan ,...sit
thiz z how 2 find the sum of first and last digit of any
number
#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
long int n,nf,nl,temp;
int count=-1;
printf("Enter a number:");
scanf("%ld",&n);
temp =n;
while(temp<0)
{
temp=temp/10;
c++;
}
nl=n%10;
nf=n/(pow(10,c));
printf("\n%ldResult=",(nf+nl));
getch();
}
Is This Answer Correct ? | 9 Yes | 23 No |
we have to use realloc only after malloc or calloc ? or we can use initially with out depending on whether we are using malloc or calloc in our program ?
how can i include my own .h file EX:- alex.h like #include<alex.h>, rather than #include"alex.h"
Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......
how can you print&scan anything using just one character? :) HINT: printf,scanf similer
write a program to find the frequency of a number
Write a program to find factorial of a number using recursive function.
what is a non volatile key word in c language?
how to find out the union of two character arrays?
how can f be used for both float and double arguments in printf? Are not they different types?
How to write in a function declaration and in function call in which the function has 'n' number of varible or arguments?
Is there a way to switch on strings?
What is a newline escape sequence?