Tag Archives: siddhartha sir

c++ assignment status

i have completed 2 assignment with c++. also practice some program using inline function.

Posted in Data Structures with C | Tagged | Leave a comment

E-14 pre-increment and logical operators

Initializing x,y,z=1 and after applying operation ++x||++y&&++z; The values when printed gives: x=2; y=1; and z=1; It increments  the value of x but does not increment the values of y and z.  can anyone please explain why?

Posted in Data Structures with C | Tagged , | Leave a comment

E-12, Assignment 1

x=y=1; z=x++-1; z+=-x++ + ++y; printf(“%d\n”,x); here x=3; but printf(“%d\n”,z); here z=?? and how??

Posted in Uncategorized | Tagged | 2 Comments

E14 Star Pattern Using for Loop.

#include<stdio.h> int main () { printf(“Program to print a pattern of stars.\n”); int i1,i2,i3,val; printf(“Enter a number:\n”); scanf(“%d”,&val); for(i1=0;i1<val;i1++) { /*for(i3=val;i3>i1;i3–) { printf(” “); }*/ for(i2=0;i2<=i1;i2++) { printf(“*”); } printf(“\n”); } return 0; } I tried to print a pattern … Continue reading

Posted in Data Structures with C | Tagged | 3 Comments

resizing structures as per the number of total bytes declared

To resize the structure as per the number of total bytes declared in structure we use the #pragma directive. The #pragma pack directive modifies the current alignment rule for members of structures following the directive. syntax: ex–>#pragma pack(1)

Posted in Uncategorized | Tagged | Leave a comment