Posts

Showing posts from January, 2021

C Language

 C Language Default Program Layout # include <stdio.h> int main() { return 0; } Note:  Put semi column on each line between the brackets. Usage of % on few letters %c = Single Char %d = Integer Char    %f = decimal  %s = charcter  How Variable Works char characterName[] = "Tom"; int characterAge = 67; printf("There one was a man named %s\n", charcterName); printf("he was %d years old.\n", charcterAge); /*If Age need to change in between*/ characterAge=30 printf(" He really liked the name %s\n", characterName); printf(" but did not like being %d.\n", charcterAge); Data Types in C int age = 40; double gpa = 3.6; char grade = 'A'; char phrase [ ] =  " Learning C Language"; All below statements works similar printf("my fav %s is %f", "number", 500); /// check/// printf("%d", 500); printf(" My fav number is %d, 500); \* To run a program in Visual code use the below commands after sav...