EmbLogic's Blog

why value are not reading trough scanf

#include<stdio.h>
int main()
{
double a,b,c;

printf(“Enter the temprature in fahrenheit “);
scanf(“%e”,&a);
c=1.8*a+32;
b=1.8*a+32+273.16;
printf(“the conversion in fahrenheite %e celcius is %3.2e and is %6.2\n”,a,c,b);

return 0;
}

i  am reading the value through scanf and storing the value in double a as highlighted.

i am getting only garbage at output why.
Enter the temprature in fahrenheit 21  //what had happened to a ? why its is not storing the value.

the conversion in fahrenheite 1.978588e+65 celcius is 3.56e+65 and is 3.56e+65 

Posted in Data Structures with C | 1 Comment

why printf giving value without using variable name

int ten = 10;
int two = 2,z=3;
printf(“Doing it right: “);
printf(“%d minus %d is %d \n”,ten,2,ten-two);
printf(“Doing it wrong: “);
printf(“%d minus %d is %d\n”,ten); // In this function i have not used the variable name “ten” then why it is not giving the error on compilation.

if “,” and name of variable are not declared then it also give output instead of error.

OUTPUT

Doing it right: 10 minus 2 is 8
Doing it wrong: 10 minus 2 is 8

if i use

printf(“%d minus %d is %d\n”,z);

then OUTPUT

Doing it wrong: 3 minus 2 is 8

Posted in Data Structures with C | Leave a comment

Touchpad driver

Sir , I want to know which touchpad driver has been there in my laptop , is it a generic driver which has been used for different laptops ?

Posted in Character Driver | 1 Comment

issues with question 18 of assgn1

#include<stdio.h>
int main()
{

long double mwt = 3.0e-23;
printf(“%LF”,mwt);
return 0;
}

why o/p is

./seventeen
0.000000

root@linuxstation asgmt#

Posted in Data Structures with C | 1 Comment

[Query][Assignment 2] Unexpected output

For the third question in the second assignment, the output has an extra character ‘S’ printed.
This indicates that the switch case with the value ’9′ was run. But there is no apparent code that puts 9 to the value of ‘c’.

Please guide me through the explanation. Here is the code.
Thanks.

Posted in Data Structures with C | Leave a comment

Is there any way to undo the updation of the profile plz help me….:(

Posted in Uncategorized | Leave a comment

5 stages of compiler

Compilation process in general is split into roughly 5 stages and those are as follows:-
1. Preprocessing
2. Parsing
3. Translation
4. Assembling
5. Linking

Posted in Data Structures with C | 1 Comment

Assignment 1

Completed assignment 1, started second assignment

 

Posted in Data Structures with C | 1 Comment

To Pravjot Sir : Compilation steps for a C code

Compilation Steps  For a Hello World program :

#include<stdio.h>

int main()

{
printf(“Hello World \n”);
return 0;
}

Step One :The C preprocessor implements the macro language used to transform C,C++, and Objective-C programs before they are compiled.

aregee@linuxstation src_projects$ cpp hello.c > hello.i

aregee@linuxstation src_projects$ ls
hello.i
hello.c
aregee@linuxstation src_projects$

Step Two : In this stage the hello.i is compiled to assembly language. -S option with gcc creates a hello.s file

aregee@linuxstation src_projects$ gcc -S hello.i
aregee@linuxstation src_projects$ ls
bashme Depriciated Gdata_Module hello.i m_c resultworks
Ddev file_rem.py hello.c hello.s Pong_game

Step Three : The Assembler can be invoked with the following command and what assembler does is to convert the hello.s to  ELF(executable linked format)  hello.o

aregee@linuxstation src_projects$ as hello.s -o hello.o
aregee@linuxstation src_projects$ ls
bashme Depriciated Gdata_Module hello.i hello.s Pong_game
Ddev file_rem.py hello.c hello.o m_c resultworks
aregee@linuxstation src_projects$

+++++reading hello.o++++++++++

$ readelf -a hello.o

Step Four : The Linker  links all the resources required for the execution,thus it links /loads the .so libraries dynamically during the run time…

To link the hello.o file to the dependent libraries,

aregee@linuxstation src_projects$ gcc hello.o
aregee@linuxstation src_projects$ ls
a.out Ddev file_rem.py hello.c hello.o m_c resultworks
bashme Depriciated Gdata_Module hello.i hello.s Pong_game
aregee@linuxstation src_projects$

aregee@linuxstation src_projects$ ./a.out
Hello World

Finding Dynamically linked libraries  :

aregee@linuxstation src_projects$ ldd a.out
linux-vdso.so.1 => (0x00007fffaf962000)
libc.so.6 => /lib64/libc.so.6 (0x0000003d0bc00000)
/lib64/ld-linux-x86-64.so.2 (0x0000003d0b400000)

 

Posted in Data Structures with C | 2 Comments

size command

#include<stdio.h>  // filename hello.c
int main()
{
printf(“hello i m ASHWANI\n”);
}
]# size hello

text       data        bss        dec        hex    filename
1149        492         16       1657        679    hello
what does it mean? plz reply….

Posted in Uncategorized | Leave a comment

assignment 01

completed 12 ques of assign 01

Posted in Uncategorized | Leave a comment

CVS…..

#include<stdio.h>
#include<string.h>

static char *RCSinfo = “$id$”;
vprintf(“RSC control: %s\n”,RCSinfo);
int main()
{
printf(“hello”);
return 0;

}
errors:

MACROS.c:5:9: error: expected declaration specifiers or ‘…’ before string constant
MACROS.c:5:29: error: expected declaration specifiers or ‘…’ before ‘RCSinfo’
make: *** [MACROS] Error 1

cn any1 help wid these errors….????

Posted in Uncategorized | Leave a comment

Regarding project

successfully completed the master array

working on assignment 1

Posted in Data Structures with C | Leave a comment

hi i have created the master array by reading from a text file…

Posted in Uncategorized | Leave a comment

how to print the result of an arithmetic calculation in a shell script

echo 4 +5

 

wat should i use to make its ans= 9 .

plz tell me the complete statement

Posted in Shell Scripts | 2 Comments